POST
/v1/mappings/modelsRegisters 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"andproperties. Local$refs into$defsordefinitionsare 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/modelsExample
curl -X POST https://api.certinvo.com/v1/mappings/models \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { 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