API Quickstart
Use the Cogneris API when another system needs to submit documents and consume structured results.
Connect your editor to the Cogneris MCP server and ask for the integration instead — the assistant reads this API's contract, creates the key and writes the code. See the prompt cookbook.
Before You Start
- Confirm API access is enabled for your tenant.
- Generate an API key and keep it in an environment variable such as
COGNERIS_API_KEY— never in source control. - Use the API host of your tenant's region:
https://api-eu.cogneris.ai(Europe, where new tenants are created) orhttps://api-us.cogneris.ai(United States). A key works only in its own region.
Workflow
- Send the document as
multipart/form-datawith the key in theAuthorization: Bearerheader. - Parse the response body as JSON.
- Check
hasErrorsand the HTTP status, then read the result fromdata. - Log the request identifiers or support details when a request fails.
Some Cogneris backend responses are returned with Content-Type: text/plain while the body contains JSON. API clients should parse the response body as JSON even when the content type is not application/json.
The synchronous /Document/* endpoints, including the example below, accept only a production key
(xtkt_live_). A sandbox key (xtkt_test_) — the kind an AI assistant creates unless you ask for production —
is refused with 403 and the code environment.sandbox_route_unavailable. Sandbox keys cover only the
asynchronous job flow; see API Examples.
Example
Extract the fields of an invoice:
curl -X POST "https://api-eu.cogneris.ai/Document/extraction" \
-H "Authorization: Bearer $COGNERIS_API_KEY" \
-F "file=@./invoice.pdf"
The answer carries the extracted fields in data.metadata.fields. Accepted files: .pdf, .png, .jpg,
.jpeg, .tiff, .tif, .bmp, .doc, .docx, up to 10 MB. The limit is 50 requests per minute per key.