Skip to content

API reference

Register a target model

Mappings API

POST/v1/mappings/models

Registers your own invoice model, a JSON Schema of an object, under a name and a version. A mapping card that names it ("target": {"name", "version"}) writes your JSON instead of our canonical invoice. A registered version never changes. Register a new version instead. The answer’s notChecked lists every keyword of your schema a mapping does not enforce, by its path in the schema. A mapping checks type, required, enum and a date format; the rest is yours to check.

Request body

application/json, required

  • namestringRequired
  • versionstringRequired
  • schemaobjectRequired

    A JSON Schema with "type": "object" and properties. Local $refs into $defs or definitions are followed.

Status codes

Status Meaning
201 {name, version, createdAt, notChecked}.
400 The name or version is not an address, or the schema is not an object of fields (invalid_target_model).
401 No usable credential was sent (invalid_credentials).
409 That version is registered already (target_model_exists).
POST/v1/mappings/models
Example
curl -X POST https://api.certinvo.com/v1/mappings/models \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const response = await fetch(`https://api.certinvo.com/v1/mappings/models`, {
  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

response = requests.post(
    "https://api.certinvo.com/v1/mappings/models",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
201
No response body.
Success response
POST
/v1/mappings/models
Register a target model
All
›AuthenticationRequiredBearerAuth

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

›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/mappings/models" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "version": "string",
  "schema": {}
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close