Skip to content

Get started

Check your first document

Get a test key, upload one of Kontiga’s sample documents, check it, and read the verdict and the findings behind it. About five minutes; nothing is billed.

Updated

Ask about this pageRead this page as Markdown
  1. Get a test key

    In the console, open Developers, then API keys, and create a key in test mode. It starts with kt_test_. Put it in the environment as KONTIGA_API_KEY: the SDKs, the CLI and the MCP server read it from there. An agent can get one with no person involved: see Sign up as an agent.

    Shell
    export KONTIGA_API_KEY=kt_test_...
  2. Download a sample document

    A test key takes Kontiga’s sample documents only, and every result is computed by the real checks. Each sample is an invented document with a change made after it was issued: sample-payslip-altered.pdf, a payslip whose net pay was changed after it was issued; sample-bank-statement-altered.pdf, a bank statement with a salary credit added after it was issued; sample-invoice-altered.pdf, an invoice whose total and payment account were changed after it was issued.

    Shell
    curl -fsSLO https://kontiga.com/samples/sample-payslip-altered.pdf
  3. Upload the file

    Files never travel inside an API call. Announce the file with its name, type, size and MD5 in base64; the answer gives its upload_id and the url to send its bytes to. The CLI does this and the next step for you when you name the file. See Uploads.

    curl -X POST https://api.kontiga.com/v1/uploads \
      -H "Authorization: Bearer $KONTIGA_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "purpose": "document",
        "files": [
          {
            "file_name": "sample-payslip-altered.pdf",
            "content_type": "application/pdf",
            "byte_size": 36095,
            "checksum": "ec8SMOKHhctnJMrQ4oOFdw=="
          }
        ]
      }'

    POST /v1/uploads

  4. Send the bytes

    PUT the file to its url with exactly the headers the answer gave, within 5 minutes. The storage refuses any other bytes.

    Shell
    curl -X PUT "$UPLOAD_URL" \
      -H "Content-Type: application/pdf" \
      -H "Content-MD5: ec8SMOKHhctnJMrQ4oOFdw==" \
      --data-binary @sample-payslip-altered.pdf
  5. Check the document

    Name the upload when you check the document, within the hour. wait holds the answer up to 10 seconds: if every check is done by then, the verdict is in it.

    curl -X POST https://api.kontiga.com/v1/documents \
      -H "Authorization: Bearer $KONTIGA_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "file_name": "sample-payslip-altered.pdf",
        "content_type": "application/pdf",
        "byte_size": 36095,
        "upload_id": "upl_5f2c8e1a9b7d4c3e6a0f1b2c3d4e5f60",
        "wait": 10
      }'

    POST /v1/documents

Read the result

The answer is the document as it stands. If every check finished within the wait, it is 201 with the verdict, both scores and the findings. If not, it is 202 with verdict: null and the step its check is on; the verdict follows by webhook and on every read.

201 Created
{
  "id": "doc_7Kq2Xw9",
  "object": "document",
  "mode": "test",
  "state": "checked",
  "stage": "done",
  "verdict": "high_risk",
  "risk_score": 87,
  "fraud_score": 74,
  "findings": [
    {
      "id": "tag_6Rv2Np9",
      "kind": "fraud",
      "title": "The net pay was changed after the payslip was made",
      "where": "Page 1, the net pay box",
      "page": 1
    },
    {
      "id": "tag_3Lm8Qe5",
      "kind": "information",
      "title": "The issuer's details are the same throughout the document",
      "where": "Whole page",
      "page": 1
    }
  ]
}
  • verdict is one word: trusted, review or high_risk. It follows the higher of the two scores. See Verdicts and scores.
  • risk_score says how likely the file was changed after it was issued, or made up. fraud_score says how likely the document is fraud, for its type.
  • Each finding has its kind, fraud, information or positive, and where on the page it was found. See Documents.

Next