# Check your first document

> Kontiga is document fraud detection by Bynn Intelligence for insurers, letting agents, lenders and HR screening teams: every document is compared with a proprietary library of more than 300 million original documents, gathered over 20 years.

Documentation index: https://kontiga.com/llms.txt

Section: Get started. URL: https://kontiga.com/docs/quickstart

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 December 1, 2026

## 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](https://kontiga.com/docs/agents).

```bash
export KONTIGA_API_KEY=kt_test_...
```

## 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`](https://kontiga.com/samples/sample-payslip-altered.pdf), a payslip whose net pay was changed after it was issued; [`sample-bank-statement-altered.pdf`](https://kontiga.com/samples/sample-bank-statement-altered.pdf), a bank statement with a salary credit added after it was issued; [`sample-invoice-altered.pdf`](https://kontiga.com/samples/sample-invoice-altered.pdf), an invoice whose total and payment account were changed after it was issued.

```bash
curl -fsSLO https://kontiga.com/samples/sample-payslip-altered.pdf
```

## 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](https://kontiga.com/docs/uploads).

API:

```bash
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=="
      }
    ]
  }'
```

CLI:

```bash
kontiga uploads create --purpose document
```

MCP tool `create_uploads`:

```json
{
  "name": "create_uploads",
  "arguments": {
    "purpose": "document",
    "files": [
      {
        "file_name": "sample-payslip-altered.pdf",
        "content_type": "application/pdf",
        "byte_size": 36095,
        "checksum": "ec8SMOKHhctnJMrQ4oOFdw=="
      }
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.uploads.create({
  purpose: "document",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.uploads.create(purpose="document")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Uploads.Create(ctx, &kontiga.UploadsCreateParams{
	Purpose: "document",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.uploads().create(UploadsCreateParams.builder()
    .purpose("document")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Uploads.CreateAsync(new UploadsCreateOptions
{
    Purpose = "document",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->uploads->create([
    'purpose' => 'document',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.uploads.create(purpose: "document")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .uploads()
    .create(kontiga::uploads::CreateParams {
        purpose: "document".into(),
        ..Default::default()
    })
    .await?;
```

## 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.

```bash
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/pdf" \
  -H "Content-MD5: ec8SMOKHhctnJMrQ4oOFdw==" \
  --data-binary @sample-payslip-altered.pdf
```

## 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.

API:

```bash
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
  }'
```

CLI:

```bash
kontiga documents check sample-payslip-altered.pdf --wait 10
```

MCP tool `check_document`:

```json
{
  "name": "check_document",
  "arguments": {
    "file_name": "sample-payslip-altered.pdf",
    "content_type": "application/pdf",
    "byte_size": 36095,
    "upload_id": "upl_5f2c8e1a9b7d4c3e6a0f1b2c3d4e5f60",
    "wait": 10
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";
import { openAsBlob } from "node:fs";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.check({
  file: await openAsBlob("sample-payslip-altered.pdf"),
  wait: 10,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.check(file=open("sample-payslip-altered.pdf", "rb"), wait=10)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.Check(ctx, &kontiga.DocumentsCheckParams{
	File: kontiga.FileFromPath("sample-payslip-altered.pdf"),
	Wait: 10,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().check(DocumentsCheckParams.builder()
    .file(Path.of("sample-payslip-altered.pdf"))
    .wait(10)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.CheckAsync(new DocumentsCheckOptions
{
    File = File.OpenRead("sample-payslip-altered.pdf"),
    Wait = 10,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->check([
    'file' => fopen('sample-payslip-altered.pdf', 'r'),
    'wait' => 10,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.check(file: File.open("sample-payslip-altered.pdf"), wait: 10)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .check(kontiga::documents::CheckParams {
        file: kontiga::File::open("sample-payslip-altered.pdf").await?,
        wait: 10,
        ..Default::default()
    })
    .await?;
```

## 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**

```json
{
  "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](https://kontiga.com/docs/concepts/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](https://kontiga.com/docs/documents).

## Next

- [Check a document](https://kontiga.com/docs/guides/check-a-document): Stages, webhooks, waiting and the failures to plan for.
- [Keys and test mode](https://kontiga.com/docs/keys-and-test-mode): Key kinds, scopes and what test mode accepts.
