Before you start
- A key with
documents:write, or a member role of Owner, Admin or Analyst. A Developer checks documents in test mode. - A PDF or a photo (JPEG, PNG, HEIC, HEIF, TIFF or WebP), up to 64 MB. A PDF is read up to its 50th page.
- In test mode, one of Kontiga’s sample documents.
Send the document
The CLI and the SDKs upload the file and create the document in one step. On the API it is two calls: POST /v1/uploads gives a presigned address to put the file at, then POST /v1/documents names the upload. The answer comes at once with the document’s id.
curl -X POST https://api.kontiga.com/v1/documents \
-H "Authorization: Bearer $KONTIGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_name": "bank-statement-may.pdf",
"content_type": "application/pdf",
"byte_size": 391168,
"upload_id": "upl_4f1c9a2e7b3d4c5a8e6f0b1d2c3a4e5f",
"wait": 10
}'POST /v1/documents
Get the result
Three ways, whichever suits your code. Most integrations use the webhook and fetch only to show a document again.
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e \
-H "Authorization: Bearer $KONTIGA_API_KEY"GET /v1/documents/{document_id}
Read the verdict
The verdict comes only once every check has finished, never while one runs. Start from the verdict, then read the tags behind it. A fraud tag says what was found and where on the page; an information tag is a fact to weigh; a positive tag speaks for the document. The two scores are separate: one for changes to the file, one for fraud for this type of document. A document the checks could not finish on reads Review, and verdict_reason says why. See Verdicts and scores.
When it does not go through
Test mode
A test key, or the console’s test switch, checks Kontiga’s sample documents only, with the real checks and never billed: a payslip, a bank statement, an identity card as a PDF and as a photo, a utility bill, an invoice and an employment contract. Download them from the Documents page of the console in test mode. Any other file answers 422 test_mode_sample_only. A sample shows everything wherever it is checked.
Put it in a case later
A checked document can join a case at any time, and keeps its result. See Cases.