Skip to content

API reference

Ask AI about the open columns of a kept draft

Mappings API

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

Map with AI. The model is asked only about columns the draft leaves open: all of them, or the ones in columns. It sees the file’s structure (column names, places and value types), never a data value. It needs a yes for this request (consent: true) or the company’s AI setting. Each answer is kept on the draft as a proposal (proposal.by is ai-suggest) that a person accepts with a decision; nothing is mapped by this request. A PDF draft is not asked this way: its page is read when it is uploaded, after its own question. Every request that reaches the model is recorded with the tokens it cost.

Path parameters

  • idstring (uuid)Required

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

Request body

application/json

  • columnsarray of string

    The open columns to ask about, by source. Without it, every open column.

  • consentboolean

    true: the person said yes for this request. Not needed while the company setting for AI is on.

Status codes

Status Meaning
200 The draft, as GET /v1/mappings/drafts/{id} answers it, and ai: asked (the columns asked), suggestions (a field per asked column, or null when none fits) and usage (inputTokens, outputTokens).
400 The body is not JSON (invalid_json), or columns is not a list of strings or consent not a boolean (invalid_ai_request).
401 No usable credential was sent (invalid_credentials).
403 ai_consent_required: no yes for this request, and the company setting for AI is off. Nothing was asked.
404 This company has no such draft (unknown_mapping_draft).
409 mapping_draft_finalized: the draft is finalized and never changes.
422 ai_not_for_pdf: a PDF draft; ai_nothing_open: every column is mapped or left out; ai_column_not_open (detail.columns): a named column is mapped, and a mapped column is never asked. Nothing was asked.
429 ai_limit_reached: the company made 50 Map with AI requests that reached the model in the last 24 hours. Nothing was asked; the columns can be mapped by hand.
502 ai_unavailable: the AI service gave no usable answer. Nothing was changed.
503 ai_not_set_up: AI is not set up on this server, nothing was sent; or profiler_unavailable.
POST/v1/mappings/drafts/{id}/ai
Example
curl -X POST https://api.certinvo.com/v1/mappings/drafts/$DRAFT_ID/ai \
  -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}/ai`, {
  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}/ai",
    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}/ai
Ask AI about the open columns 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}/ai" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "columns": [
    "string"
  ],
  "consent": true
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close