/v1/mappings/drafts/{id}/finalize{version, confirmedBy, newName?}: the card is frozen under version, confirmed by the named person, with its decisions and none of the evidence they were made from. Refused unless the last test passed on every sample for the card as it is now. A draft that starts from no frozen version is refused as a new name when a frozen mapping of this company already reads every sample: save it as the next version of one of them, under its name, or send newName: true for a file from a different system. When the card makes the same decisions as the newest version of such a mapping, nothing is frozen and that version answers (200, existing: true).
Path parameters
- idstring (uuid)Required
The draft's id, as
POST /v1/mappings/draftsanswered it.
Request body
application/json, required
- versionstringRequired
The frozen card's version, lower-case letters, digits, dots and dashes.
- confirmedBystringRequired
The e-mail address of the person who confirms, a member of this workspace.
- newNameboolean
The samples come from a different system, so the draft is frozen under its own name even when a frozen mapping already reads them.
Status codes
| Status | Meaning |
|---|---|
200 |
{version, confirmedBy, confirmedAt, existing: true}: a frozen mapping that reads these samples already makes exactly these decisions, so nothing was frozen and its version answers. |
201 |
{version, confirmedBy, confirmedAt}, as POST /v1/mappings answers. |
400 |
The card does not load under that version (invalid_mapping_config), or nobody who may confirm here was named (unknown_confirming_user). |
401 |
No usable credential was sent (invalid_credentials). |
404 |
This company has no such draft (unknown_mapping_draft). |
409 |
A column of the draft is still open (open_columns, naming each in detail.columns), no test passed on this very card (untested_mapping), the draft is finalized already (mapping_draft_finalized), that version is frozen already (mapping_config_exists), frozen mappings already read these samples and version is a version of none of them (a_saved_mapping_reads_these_samples, detail.versions naming the newest version of each), the version the draft starts from is no longer the newest of its mapping (mapping_moved_on, detail.from and detail.newest; replay the draft with POST /v1/mappings/drafts/{id}/rebase), or something else its readiness names keeps it from being saved (mapping_not_ready, with detail.reason one of missing-required, codes-unanswered, payment-keys-unanswered, policy-refused, not-executable or reads-no-file, and detail.readiness). Nothing was frozen. |
/v1/mappings/drafts/{id}/finalizecurl -X POST https://api.certinvo.com/v1/mappings/drafts/$DRAFT_ID/finalize \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const draftId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'
const response = await fetch(`https://api.certinvo.com/v1/mappings/drafts/${draftId}/finalize`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
'Content-Type': 'application/json',
},
body: await readFile('body.json'),
})
console.log(response.status, await response.json())import os
import requests
draft_id = "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
response = requests.post(
f"https://api.certinvo.com/v1/mappings/drafts/{draft_id}/finalize",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text)