Skip to content

API reference

Decide columns and fields of a kept draft

Mappings API

POST/v1/mappings/drafts/{id}/decisions

{decisions: [...]}, applied in order after the ones already kept. A decision is one of: {column, to, format?} (read the column into that field), {column, ignore} (true: not carried over; false: open again), {field, from} (the field reads that column), {field, path} (the field reads a place of the file typed by hand, a whole path; a field of a list reads inside that list), {field, format} (the converter of a field that reads the file, of the field’s kind), {field, const} (a fixed value), {field, remove: true}, {field, code, means} (one of your own codes and the official code it means, or null for no value), {field, code, remove: true} (one of your own codes taken out of the field’s table), {field, alias, remove: true} (one of the field’s other names taken out), {input: {encoding?, recordsAt?}} (how the file is read), {list, from} (where a list of the model sits in the file; placed again, it moves with its fields), or {list, from, where?, fields} (a list inside a line, whole, as a new version carries it from the live card; list and from are whole paths). Either all of them apply and are kept, or none is.

Path parameters

  • idstring (uuid)Required

    The draft's id, as POST /v1/mappings/drafts answered it.

Request body

application/json, required

  • decisionsarray of objectRequired

Status codes

Status Meaning
200 The draft, as GET /v1/mappings/drafts/{id} answers it.
400 The body is not JSON (invalid_json), or decisions is not a list of objects (invalid_decisions).
401 No usable credential was sent (invalid_credentials).
404 This company has no such draft (unknown_mapping_draft).
409 mapping_draft_finalized: the draft is finalized and never changes.
422 A decision does not apply (decision_not_applicable, detail gives its index and the decision): its column or field is not in the draft or the catalogue, or another column already writes that field. Nothing was kept.
POST/v1/mappings/drafts/{id}/decisions
Example
curl -X POST https://api.certinvo.com/v1/mappings/drafts/$DRAFT_ID/decisions \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const draftId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'

const response = await fetch(`https://api.certinvo.com/v1/mappings/drafts/${draftId}/decisions`, {
  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}/decisions",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
200
No response body.
Success response
POST
/v1/mappings/drafts/{id}/decisions
Decide columns and fields of a kept draft
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Variables1
›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/mappings/drafts/{id}/decisions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "decisions": [
    {}
  ]
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close