# Documents

> 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: Reference. URL: https://kontiga.com/docs/documents

A document is one file an end customer, a member or your own system sent: a payslip, a bank statement, an ID. Each is checked for changes and fraud and gets a verdict, a risk score, a fraud score and its findings, each with what was found and where. Check a document on its own or as part of a case, read its result, its evidence and its history, and record what it turned out to be.

Updated December 1, 2026

## Contents

- [The document object](https://kontiga.com/docs/documents#the-document-object)
- [Check a document](https://kontiga.com/docs/documents#check-a-document)
- [When a check is refused](https://kontiga.com/docs/documents#when-a-check-is-refused)
- [List documents](https://kontiga.com/docs/documents#list-documents)
- [Read the documents list's facts](https://kontiga.com/docs/documents#read-the-documents-list-facts)
- [Read a document](https://kontiga.com/docs/documents#read-a-document)
- [Mark a document opened](https://kontiga.com/docs/documents#mark-a-document-opened)
- [Read a document's checks](https://kontiga.com/docs/documents#read-a-documents-checks)
- [Read a document's evidence](https://kontiga.com/docs/documents#read-a-documents-evidence)
- [Read a document's details](https://kontiga.com/docs/documents#read-a-documents-details)
- [Read a document's history](https://kontiga.com/docs/documents#read-a-documents-history)
- [Check a document again](https://kontiga.com/docs/documents#check-a-document-again)
- [Mark a finding reviewed](https://kontiga.com/docs/documents#mark-a-finding-reviewed)
- [Add a document to a case](https://kontiga.com/docs/documents#add-a-document-to-a-case)
- [Update a document's reference, person and metadata](https://kontiga.com/docs/documents#update-a-document)
- [Download the original file](https://kontiga.com/docs/documents#download-the-original-file)
- [Download the document report](https://kontiga.com/docs/documents#download-the-document-report)
- [Read a document's known outcome](https://kontiga.com/docs/documents#read-a-known-outcome)
- [Record a known outcome](https://kontiga.com/docs/documents#record-a-known-outcome)
- [Delete a document](https://kontiga.com/docs/documents#delete-a-document)
- [Delete several documents](https://kontiga.com/docs/documents#delete-several-documents)
- [Correct a document's type](https://kontiga.com/docs/documents#correct-a-documents-type)
- [Bring in a document checked on the site](https://kontiga.com/docs/documents#bring-in-a-document-checked-on-the-site)

## The document object

- `id` (string): The document's id, starting with `doc_`.
- `mode` (enum): `live` or `test`.
- `case_id` (string): The case it is on, or `null` for a document checked on its own.
- `person_id` (string): The person it belongs to, or `null`.
- `type` (string): The document type, such as `payslip` or `bank_statement`.
- `source` (enum): How it arrived: `portal`, `api`, `upload` or `dropbox`.
- `state` (enum): `received`, `checking`, `checked_fast` (the first result is in, the full checks still run), `checked` or `failed`.
- `stage` (enum): The same in words: `received`, `reading`, `checking`, `done` or `failed`.
- `failure_reason` (enum): Why a `failed` document failed, when it is known: `not_analysed` when the document could not be analysed. It is not charged; check it again later. Absent otherwise.
- `check` (object): While its checks run: `stage` (`queued`, `reading`, `checking` or `deciding`), `percent` (how far, in tens) and `started_at`. `null` once its checks end.
- `risk_score` (number): 0 to 100: how likely the document was altered after it was made, or was generated. `null` until every check has finished.
- `fraud_score` (number): 0 to 100: how likely the document is fraud, for its type. `null` until every check has finished, and for a type it does not assess.
- `fraud_score_reason` (enum): Why a checked document has no fraud score: `unknown_type`, `test`, `rejected` or `unavailable`. `null` when it has one.
- `verdict` (enum): From the higher of the two scores, at the workspace's cut points: `trusted`, `review` or `high_risk`. `null` until every check has finished. A document the checks could not finish on reads `review`.
- `verdict_reason` (string): Why the verdict is `review` when the scores do not say it: the checks could not finish on the document, in plain words. `null` otherwise.
- `findings` (array): What was found, each with its `tag_` id, its kind (`fraud`, `information` or `positive`), a sentence, the page and the area, and whether a member reviewed it. While the full checks still run, the first checks' findings are listed with `provisional: true`; they are never counted.
- `details_locked` (object): On the free start, a checked document of the workspace's own shows its verdict, its scores and `counts` of findings by kind; which findings, the fields and the amount show once the workspace chooses a plan. Absent when everything shows: on a plan, for a sample and in test mode.
- `sample` (string): Which of Kontiga's sample documents it is; absent for your own file.
- `reference` (string): Your own id for it, or `null`.
- `checked_at` (string): When every check finished, or `null`.
- `issuer` (string): Who issued it, as read from the document: the employer, the bank, the landlord. `""` when it was not read.
- `amount` (object): The document's total as read from it: `label`, `value` and `currency` (ISO 4217). `null` when none was read.
- `fields` (array): The data read from it, each with its name, value and confidence from 0 to 1.
- `policy_findings` (array): Where it falls short of a policy linked to its case or requirement, with the passage quoted.

**A document**

```json
{
  "id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "object": "document",
  "mode": "live",
  "case_id": "case_7Kq2Xw9",
  "person_id": "per_2Nc6Qs8",
  "type": "payslip",
  "type_label": "Payslip",
  "title": "Payslip, October 2026",
  "file_name": "payslip-oct-2026.pdf",
  "issuer": "Dunmore Freight Ltd",
  "category": "income",
  "source": "portal",
  "pages": 1,
  "received_at": "2026-11-24T09:31:20Z",
  "state": "checked",
  "stage": "done",
  "check": null,
  "risk_score": 46,
  "fraud_score": 31,
  "fraud_score_reason": null,
  "verdict": "review",
  "verdict_reason": null,
  "findings": [
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051",
      "kind": "fraud",
      "title": "The net pay was changed after the payslip was made",
      "where": "Page 1, the marked area",
      "page": 1,
      "detail": "The net pay reads 3,412.50. The payslip was issued with 2,912.50.",
      "box": { "x": 0.62, "y": 0.71, "w": 0.24, "h": 0.04 },
      "reviewed": false
    },
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e00a4",
      "kind": "positive",
      "title": "Matches genuine payslips from this employer",
      "where": "The whole document",
      "page": 1,
      "detail": "It matches genuine payslips from Dunmore Freight Ltd.",
      "box": { "x": 0, "y": 0, "w": 1, "h": 1 },
      "reviewed": false
    }
  ],
  "fields": [
    { "name": "employee_name", "value": "Marta Kowalczyk", "confidence": 0.99 },
    { "name": "employer_name", "value": "Dunmore Freight Ltd", "confidence": 0.98 },
    { "name": "pay_date", "value": "2026-10-31", "confidence": 0.97 },
    { "name": "net_pay", "value": "3412.50", "confidence": 0.95 }
  ],
  "amount": { "label": "Net pay", "value": 3412.5, "currency": "EUR" },
  "policy_findings": [],
  "reference": "APP-20418-PAY-10",
  "checked_at": "2026-11-24T09:31:58Z"
}
```

## Check a document

Upload one document and get its verdict, findings and both scores, with no case or collection needed; optionally with your reference, the person it is for, the case it goes on and what you know about it.

`POST /v1/documents`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga documents check <file> [--wait <seconds>] [--reference <text>] [--person-id <person_id>] [--case-id <case_id>] [--metadata <json>]`. MCP tool: `check_document`.

**Parameters**
- `file_name` (string, required): The file's name. The CLI reads it, its type and its size from the file you give. At most 255 characters.
- `content_type` (enum, required): The file's type: a PDF or a photo. One of `application/pdf`, `image/jpeg`, `image/jpg`, `image/png`, `image/heic`, `image/heif`, `image/tiff`, `image/webp`.
- `byte_size` (integer, required): The file's size in bytes. A file is at most 64 MB.
- `upload_id` (id (upl_)): The upload that holds the file, from `POST /v1/uploads`, of this workspace and mode, used once and within its hour. Send the file exactly as it arrived, never resized or saved again.
- `wait` (integer, default 0): Seconds to wait for the first result, 0 to 10. When the first checks are done (their findings marked provisional) or the check ends in time, the answer is `201` with the document; otherwise `202` with the document as it stands. Running out of time is not an error.
- `reference` (string): Your own id for the document, up to 64 characters.
- `person_id` (id (per_)): The person's id.
- `case_id` (id (case_)): The case's id.
- `metadata` (object): What you know about it, by group: `document`, `identity`, `transaction`, `device`, `email` and `claim`, each a flat object of lower-case keys to strings, numbers, booleans or `null`.

**Returns** document: The document, received; its result arrives in stages (received, reading, checking, done) by event and on each read.

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": "statement-oct-2026.pdf",
    "content_type": "application/pdf",
    "byte_size": 248113,
    "upload_id": "upl_4f1c9a2e7b3d4c5a8e6f0b1d2c3a4e5f",
    "wait": 10
  }'
```

CLI:

```bash
kontiga documents check statement-oct-2026.pdf --wait 10
```

MCP tool `check_document`:

```json
{
  "name": "check_document",
  "arguments": {
    "file_name": "statement-oct-2026.pdf",
    "content_type": "application/pdf",
    "byte_size": 248113,
    "upload_id": "upl_4f1c9a2e7b3d4c5a8e6f0b1d2c3a4e5f",
    "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("statement-oct-2026.pdf"),
  wait: 10,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.check(file=open("statement-oct-2026.pdf", "rb"), wait=10)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.Check(ctx, &kontiga.DocumentsCheckParams{
	File: kontiga.FileFromPath("statement-oct-2026.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("statement-oct-2026.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("statement-oct-2026.pdf"),
    Wait = 10,
});
```

PHP:

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

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.check(file: File.open("statement-oct-2026.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("statement-oct-2026.pdf").await?,
        wait: 10,
        ..Default::default()
    })
    .await?;
```

Response, 202 Accepted:

```json
{
  "id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
  "object": "document",
  "mode": "live",
  "case_id": null,
  "person_id": null,
  "type": "unknown",
  "type_label": "Document",
  "title": "statement-oct-2026.pdf",
  "file_name": "statement-oct-2026.pdf",
  "issuer": "",
  "category": "company",
  "source": "api",
  "pages": null,
  "received_at": "2026-11-27T10:02:44Z",
  "state": "received",
  "stage": "received",
  "check": { "stage": "queued", "percent": 0, "started_at": "2026-11-27T10:02:44Z" },
  "risk_score": null,
  "fraud_score": null,
  "fraud_score_reason": null,
  "verdict": null,
  "verdict_reason": null,
  "findings": [],
  "fields": [],
  "amount": null,
  "policy_findings": [],
  "reference": null,
  "checked_at": null
}
```

## When a check is refused

Refusals of documents.check

| Answer | Means | Do |
| --- | --- | --- |
| `404 not_found` | No upload with this id in this workspace and mode. | Upload the file in the same workspace and mode. |
| `409 upload_consumed` | The upload was used already. | Upload the file again to check it again. |
| `409 upload_not_received` | The file has not arrived at its upload address. | PUT it there first. |
| `422 file_type_mismatch` | The file's bytes are not the type it was uploaded as. | Upload it again with its own type. |
| `422 test_mode_sample_only` | Test mode checks Kontiga's sample documents only; `details.samples` says where they are. | Use a sample, or switch to live mode. |
| `402 insufficient_credit` | `details.reason` says why: `free_allowance_used`, `plan_required`, `allowance_used` or `balance_empty`. | Choose a plan or add credit. |

## List documents

Every document of the workspace, however it arrived, on a case or not.

`GET /v1/documents`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents list [--case-id <case_id>] [--person-id <person_id>] [--state <received|checking|checked_fast|checked|failed>] [--verdict <trusted|review|high_risk>] [--standalone] [--q <text>] [--limit <n>] [--cursor <cursor>]`. MCP tool: `list_documents`.

**Parameters**
- `case_id` (id (case_)): Only the documents on this case.
- `person_id` (id (per_)): Only this person's documents.
- `state` (enum): Only documents in this state. One of `received`, `checking`, `checked_fast`, `checked`, `failed`.
- `verdict` (enum): Only documents with this verdict. One of `trusted`, `review`, `high_risk`.
- `standalone` (boolean): `true` for documents checked on their own, with no case.
- `q` (string): Words in the file name or the document type. At most 200 characters.
- `limit` (integer): How many to answer, 1 to 200. The answer's `next_cursor` reads the next page.
- `cursor` (string): The `next_cursor` of the page before: the documents after it, newest first. Left out, the first page. At most 512 characters.

**Returns** list of documents: The documents, newest first, each with its stage, verdict and scores.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/documents?case_id=case_7Kq2Xw9&limit=50" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents list --case-id case_7Kq2Xw9 --limit 50
```

MCP tool `list_documents`:

```json
{
  "name": "list_documents",
  "arguments": {
    "case_id": "case_7Kq2Xw9",
    "limit": 50
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.list({
  case_id: "case_7Kq2Xw9",
  limit: 50,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.list(case_id="case_7Kq2Xw9", limit=50)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.List(ctx, &kontiga.DocumentsListParams{
	CaseId: "case_7Kq2Xw9",
	Limit:  50,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().list(DocumentsListParams.builder()
    .caseId("case_7Kq2Xw9")
    .limit(50)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.ListAsync(new DocumentsListOptions
{
    CaseId = "case_7Kq2Xw9",
    Limit = 50,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->list([
    'case_id' => 'case_7Kq2Xw9',
    'limit' => 50,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.list(case_id: "case_7Kq2Xw9", limit: 50)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .list(kontiga::documents::ListParams {
        case_id: "case_7Kq2Xw9".into(),
        limit: 50,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "list",
  "items": [
    {
      "id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
      "object": "document",
      "title": "statement-oct-2026.pdf",
      "state": "checking",
      "stage": "checking",
      "check": { "stage": "checking", "percent": 60, "started_at": "2026-11-27T10:02:44Z" },
      "verdict": null,
      "risk_score": null,
      "fraud_score": null
    },
    {
      "id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
      "object": "document",
      "title": "Payslip, October 2026",
      "state": "checked",
      "stage": "done",
      "check": null,
      "verdict": "review",
      "risk_score": 46,
      "fraud_score": 31
    }
  ],
  "next_cursor": "AZP2osXie3s9TR9qe4ycDg",
  "has_more": true
}
```

## Read the documents list's facts

What the documents list shows beside each document: whether a member has opened it yet, until when its files are kept, who signed it, and how far its checks are while they run.

`GET /v1/documents/facts`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents facts [--document-ids <document_id>,...]`. MCP tool: `list_document_facts`.

**Parameters**
- `document_ids` (array of id (doc_)): The documents to read, up to 500. Left out, the newest 500 of the list. Each answers `opened_at`, `files_until` (when its files are deleted under the workspace's retention), `signed_by` and, while its checks run, `check`.

**Returns** document facts: For each document: when it was first opened, until when its files are kept, who signed it, and its check's progress while it runs.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/documents/facts?document_ids=doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e%2Cdoc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents facts \
  --document-ids doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e,doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a
```

MCP tool `list_document_facts`:

```json
{
  "name": "list_document_facts",
  "arguments": {
    "document_ids": [
      "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
      "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"
    ]
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.listFacts({
  document_ids: ["doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.list_facts(document_ids=["doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"])
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.ListFacts(ctx, &kontiga.DocumentsListFactsParams{
	DocumentIds: []string{"doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().listFacts(DocumentsListFactsParams.builder()
    .documentIds(List.of("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.ListFactsAsync(new DocumentsListFactsOptions
{
    DocumentIds = new[] { "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a" },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->listFacts([
    'document_ids' => ['doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e', 'doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a'],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.list_facts(document_ids: ["doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"])
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .list_facts(kontiga::documents::ListFactsParams {
        document_ids: vec!["doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into(), "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a".into()],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_facts",
  "documents": [
    {
      "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
      "opened_at": "2026-11-24T10:02:18Z",
      "files_until": "2027-02-22T09:31:20Z",
      "signed_by": null,
      "check": null
    },
    {
      "document_id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
      "opened_at": null,
      "files_until": "2027-02-25T10:02:44Z",
      "signed_by": "Kilbride Savings Bank",
      "check": {
        "stage": "checking",
        "percent": 60,
        "as_of": "2026-11-27T10:02:58Z",
        "expected_done_at": "2026-11-27T10:03:30Z"
      }
    }
  ]
}
```

## Read a document

One document: its verdict, both scores, every finding with what was found and where, the fields read from it and its policy findings.

`GET /v1/documents/{document_id}`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents get <document_id>`. MCP tool: `get_document`.

**Parameters**
- `document_id` (id (doc_), required): The document to read. In the path.

**Returns** document: The document with its result at its current stage.

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents get doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `get_document`:

```json
{
  "name": "get_document",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.get("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.get("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.Get(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().get("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.GetAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->get('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.get("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .get("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "object": "document",
  "mode": "live",
  "case_id": "case_7Kq2Xw9",
  "person_id": "per_2Nc6Qs8",
  "type": "payslip",
  "type_label": "Payslip",
  "title": "Payslip, October 2026",
  "file_name": "payslip-oct-2026.pdf",
  "issuer": "Dunmore Freight Ltd",
  "category": "income",
  "source": "portal",
  "pages": 1,
  "received_at": "2026-11-24T09:31:20Z",
  "state": "checked",
  "stage": "done",
  "check": null,
  "risk_score": 46,
  "fraud_score": 31,
  "fraud_score_reason": null,
  "verdict": "review",
  "verdict_reason": null,
  "findings": [
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051",
      "kind": "fraud",
      "title": "The net pay was changed after the payslip was made",
      "where": "Page 1, the marked area",
      "page": 1,
      "detail": "The net pay reads 3,412.50. The payslip was issued with 2,912.50.",
      "box": { "x": 0.62, "y": 0.71, "w": 0.24, "h": 0.04 },
      "reviewed": false
    },
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e00a4",
      "kind": "positive",
      "title": "Matches genuine payslips from this employer",
      "where": "The whole document",
      "page": 1,
      "detail": "It matches genuine payslips from Dunmore Freight Ltd.",
      "box": { "x": 0, "y": 0, "w": 1, "h": 1 },
      "reviewed": false
    }
  ],
  "fields": [
    { "name": "employee_name", "value": "Marta Kowalczyk", "confidence": 0.99 },
    { "name": "employer_name", "value": "Dunmore Freight Ltd", "confidence": 0.98 },
    { "name": "pay_date", "value": "2026-10-31", "confidence": 0.97 },
    { "name": "net_pay", "value": "3412.50", "confidence": 0.95 }
  ],
  "amount": { "label": "Net pay", "value": 3412.5, "currency": "EUR" },
  "policy_findings": [],
  "reference": "APP-20418-PAY-10",
  "checked_at": "2026-11-24T09:31:58Z"
}
```

## Mark a document opened

Record that a member opened a document, so the list stops marking it new. The document page does it when it opens; the first time is kept.

`POST /v1/documents/{document_id}/opened`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents mark-opened <document_id>`. MCP tool: `mark_document_opened`.

**Parameters**
- `document_id` (id (doc_), required): The document a member opened. The first time is kept; a later call answers it unchanged. In the path.

**Returns** opened: When the document was first opened.

API:

```bash
curl -X POST https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/opened \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents mark-opened doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `mark_document_opened`:

```json
{
  "name": "mark_document_opened",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.markOpened("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.mark_opened("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.MarkOpened(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().markOpened("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.MarkOpenedAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->markOpened('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.mark_opened("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .mark_opened("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "opened_at": "2026-11-24T10:02:18Z"
}
```

## Read a document's checks

How many checks a document was run through, how many passed, and how many found something, by kind (fraud, information, positive), with the findings they gave.

`GET /v1/documents/{document_id}/checks`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents checks <document_id>`. MCP tool: `list_document_checks`.

**Parameters**
- `document_id` (id (doc_), required): The document whose checks to count. In the path.

**Returns** document checks: The total of checks, how many passed and how many found something, by kind, and the ids of the findings they gave; each null until every check has finished, with the stage it is at in stage.

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/checks \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents checks doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `list_document_checks`:

```json
{
  "name": "list_document_checks",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.listChecks("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.list_checks("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.ListChecks(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().listChecks("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.ListChecksAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->listChecks('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.list_checks("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .list_checks("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_checks",
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "state": "done",
  "total": 148,
  "passed": 146,
  "found": { "fraud": 1, "information": 0, "positive": 1 },
  "policy_findings": 0,
  "stage": null,
  "finding_ids": {
    "fraud": ["tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051"],
    "information": [],
    "positive": ["tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e00a4"]
  }
}
```

## Read a document's evidence

Each finding on a document with where it is on the page, and the document's verdict and scores.

`GET /v1/documents/{document_id}/evidence`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents evidence <document_id>`. MCP tool: `get_document_evidence`.

**Parameters**
- `document_id` (id (doc_), required): The document whose evidence to read. In the path.

**Returns** document evidence: Each finding with where it is on the page, and the document's verdict and scores.

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/evidence \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents evidence doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `get_document_evidence`:

```json
{
  "name": "get_document_evidence",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.evidence("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.evidence("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.Evidence(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().evidence("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.EvidenceAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->evidence('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.evidence("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .evidence("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_evidence",
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "verdict": "review",
  "risk_score": 46,
  "fraud_score": 31,
  "findings": [
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051",
      "kind": "fraud",
      "title": "The net pay was changed after the payslip was made",
      "where": "Page 1, the net pay box",
      "page": 1,
      "box": { "x": 0.62, "y": 0.71, "w": 0.24, "h": 0.04 }
    }
  ]
}
```

## Read a document's details

What a document states about itself: your reference, the country, who sent it, and the file's name, type, pages and fingerprint (SHA-256).

`GET /v1/documents/{document_id}/details`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents details <document_id>`. MCP tool: `get_document_details`.

**Parameters**
- `document_id` (id (doc_), required): The document whose details to read. In the path.

**Returns** document details: The document's reference, country, workspace and sender, and its file's name, type, pages and fingerprint.

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/details \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents details doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `get_document_details`:

```json
{
  "name": "get_document_details",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.getDetails("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.get_details("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.GetDetails(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().getDetails("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.GetDetailsAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->getDetails('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.get_details("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .get_details("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_details",
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "reference": "APP-20418-PAY-10",
  "compatible_id": { "submission_id": "document_1Kq8Vd3Xr5Tn2Bw7Ys9Hc4", "request_id": "M2URN5KEF" },
  "country": { "code": "IE", "name": "Ireland" },
  "workspace": { "id": "ws_0193c1a2b3c44d5e8f60718293a4b5c6", "name": "Harbourline Lending", "region": "eu-west-1" },
  "received_from": { "kind": "person", "name": "Marta Kowalczyk" },
  "file": {
    "name": "payslip-oct-2026.pdf",
    "content_type": "application/pdf",
    "pages": 1,
    "sha256": "9f2c4e7a1b3d58c06e2f9a4b7d1c3e5f80a2b4c6d8e0f1a3b5c7d9e1f2a4b6c8"
  },
  "metadata": {
    "transaction": { "loan_amount": 285000, "currency": "EUR" }
  }
}
```

## Read a document's history

Who sent a document and for which party, the checklist item it answers, each time it was asked for again and why, its expert reviews, the later file that replaced it, why its checks could not finish and each time it was checked again, and what later checks found.

`GET /v1/documents/{document_id}/history`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents history <document_id>`. MCP tool: `get_document_history`.

**Parameters**
- `document_id` (id (doc_), required): The document whose history to read. Each time it was checked again reads `running` while that check waits or runs, then `finished` with the verdict or `stopped`; `failure.can_retry` is `false` meanwhile. In the path.

**Returns** document history: The sender, the party and item, the times it was asked again, and the expert reviews.

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/history \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents history doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `get_document_history`:

```json
{
  "name": "get_document_history",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.history("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.history("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.History(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().history("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.HistoryAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->history('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.history("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .history("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_history",
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "sent_by": { "type": "end_customer", "id": "per_2Nc6Qs8", "name": "Marta Kowalczyk" },
  "party": { "id": "pty_9Hd4Vb1", "person_id": "per_2Nc6Qs8", "name": "Marta Kowalczyk", "role": "applicant" },
  "case": { "id": "case_7Kq2Xw9", "reference": "APP-20418" },
  "item": { "request_id": "rqs_4Gt7Uy2", "item_id": "itm_2Xc9Lb6", "state": "received" },
  "asked_again": [],
  "expert_reviews": [
    {
      "id": "exr_7Fp3Qa1",
      "state": "in_progress",
      "asked_by": "Ines Moreau",
      "question": "Is the net pay on this payslip the one the employer issued?",
      "requested_at": "2026-11-25T11:40:12Z",
      "finding": null
    }
  ],
  "replaced_by": null,
  "failure": null,
  "checked_again": [],
  "monitoring": [],
  "type_corrections": [
    { "type": "payslip", "type_label": "Payslip", "by": "Ines Moreau", "at": "2026-11-24T10:05:31Z" }
  ]
}
```

## Check a document again

Run the checks again on a document whose checks stopped before they finished. The failure stays in its history, with each try; nothing is charged twice. A document whose checks finished is refused.

`POST /v1/documents/{document_id}/check_again`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga documents check-again <document_id> [--wait <seconds>]`. MCP tool: `check_document_again`.

**Parameters**
- `document_id` (id (doc_), required): A document whose checks stopped before they finished: its `stage` is `failed`. A document whose checks finished, or are running, is refused with `409`. In the path.
- `wait` (integer): Seconds to wait for the checks to end, 0 to 10, as when you check a document. When they end in time the answer is `200` with `finished` and the verdict, or `stopped`; otherwise `202` with `running`, and the document shows the result once it is in. Nothing is charged again.

**Returns** check: How the checks went this time: running while they run past the wait, finished with a verdict, or stopped again, and how many times they have been tried.

API:

```bash
curl -X POST https://api.kontiga.com/v1/documents/doc_0193f6c3d4e5f6071829304a5b6c7d8e/check_again \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents check-again doc_0193f6c3d4e5f6071829304a5b6c7d8e
```

MCP tool `check_document_again`:

```json
{
  "name": "check_document_again",
  "arguments": {
    "document_id": "doc_0193f6c3d4e5f6071829304a5b6c7d8e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.checkAgain("doc_0193f6c3d4e5f6071829304a5b6c7d8e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.check_again("doc_0193f6c3d4e5f6071829304a5b6c7d8e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.CheckAgain(ctx, "doc_0193f6c3d4e5f6071829304a5b6c7d8e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().checkAgain("doc_0193f6c3d4e5f6071829304a5b6c7d8e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.CheckAgainAsync("doc_0193f6c3d4e5f6071829304a5b6c7d8e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->checkAgain('doc_0193f6c3d4e5f6071829304a5b6c7d8e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.check_again("doc_0193f6c3d4e5f6071829304a5b6c7d8e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .check_again("doc_0193f6c3d4e5f6071829304a5b6c7d8e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_check_again",
  "document_id": "doc_0193f6c3d4e5f6071829304a5b6c7d8e",
  "result": "finished",
  "tries": 2,
  "verdict": "trusted",
  "checked_at": "2026-11-27T10:41:09Z"
}
```

## Mark a finding reviewed

Mark a finding on a document as looked at, or not; the finding itself does not change.

`POST /v1/documents/{document_id}/findings/{finding_id}/review`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga documents review-finding <document_id> <finding_id> [--reviewed=false]`. MCP tool: `mark_finding_reviewed`.

**Parameters**
- `document_id` (id (doc_), required): The document the finding is on. In the path.
- `finding_id` (string, required): The finding: a `tag_` id, or a policy finding's `pfn_` id. In the path.
- `reviewed` (boolean, default true): `false` takes the mark off again.

**Returns** document: The document with the finding marked.

API:

```bash
curl -X POST https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/findings/tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051/review \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents review-finding doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051
```

MCP tool `mark_finding_reviewed`:

```json
{
  "name": "mark_finding_reviewed",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
    "finding_id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.reviewFinding("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.review_finding("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.ReviewFinding(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().reviewFinding("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.ReviewFindingAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->reviewFinding('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e', 'tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.review_finding("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .review_finding("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into(), "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "object": "document",
  "verdict": "review",
  "risk_score": 46,
  "fraud_score": 31,
  "findings": [
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051",
      "kind": "fraud",
      "title": "The net pay was changed after the payslip was made",
      "reviewed": true
    }
  ]
}
```

## Add a document to a case

Put a document checked on its own, or uploaded, on a case.

`POST /v1/cases/{case_id}/documents`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga cases add-document <case_id> --document-id <document_id>`. MCP tool: `add_document_to_case`.

**Parameters**
- `document_id` (id (doc_), required): A document with no case yet. It takes the case's first party as its person when it has none.
- `case_id` (id (case_), required): The case to put it on. In the path.

**Returns** document: The document, on the case.

API:

```bash
curl -X POST https://api.kontiga.com/v1/cases/case_7Kq2Xw9/documents \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document_id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"
  }'
```

CLI:

```bash
kontiga cases add-document case_7Kq2Xw9 \
  --document-id doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a
```

MCP tool `add_document_to_case`:

```json
{
  "name": "add_document_to_case",
  "arguments": {
    "document_id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
    "case_id": "case_7Kq2Xw9"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.addToCase("case_7Kq2Xw9", {
  document_id: "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.add_to_case("case_7Kq2Xw9", document_id="doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.AddToCase(ctx, "case_7Kq2Xw9", &kontiga.DocumentsAddToCaseParams{
	DocumentId: "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().addToCase("case_7Kq2Xw9", DocumentsAddToCaseParams.builder()
    .documentId("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.AddToCaseAsync("case_7Kq2Xw9", new DocumentsAddToCaseOptions
{
    DocumentId = "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->addToCase('case_7Kq2Xw9', [
    'document_id' => 'doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.add_to_case("case_7Kq2Xw9", document_id: "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .add_to_case("case_7Kq2Xw9".into(), kontiga::documents::AddToCaseParams {
        document_id: "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
  "object": "document",
  "mode": "live",
  "case_id": "case_7Kq2Xw9",
  "person_id": "per_2Nc6Qs8",
  "title": "Bank statement, October 2026",
  "stage": "done",
  "verdict": "trusted"
}
```

## Update a document's reference, person and metadata

Set your own reference on a document, the person it belongs to, and what you know about it, by group (the document, the identity, the transaction, the device, the email, the claim), as Bynn's characteristics on submission. A group you send replaces that group; null removes it.

`PATCH /v1/documents/{document_id}`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga documents update <document_id> [--reference <text>] [--person-id <person_id>] [--metadata <json>]`. MCP tool: `update_document`.

**Parameters**
- `document_id` (id (doc_), required): The document to change. In the path.
- `reference` (string): Your own id for the document, up to 64 characters. `null` clears it.
- `person_id` (id (per_)): Whose document it is. A document is given to a person by adding it to their case (`POST /v1/cases/{case_id}/documents`), so here only `null` is taken; a person's id is refused with where to do it. `null` clears it.
- `metadata` (object): What you know about it, by group: `document`, `identity`, `transaction`, `device`, `email` and `claim`. Each group is a flat object of lower-case keys to strings, numbers, booleans or `null`. A group you send replaces that group, a group sent as `null` is removed, and groups you leave out stay.

**Returns** document details: The document's details, with the reference and the metadata as they are now.

API:

```bash
curl -X PATCH https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "APP-20418-PAY-10",
    "metadata": {
      "transaction": {
        "loan_amount": 285000,
        "currency": "EUR"
      }
    }
  }'
```

CLI:

```bash
kontiga documents update doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e \
  --reference APP-20418-PAY-10 \
  --metadata '{"transaction":{"loan_amount":285000,"currency":"EUR"}}'
```

MCP tool `update_document`:

```json
{
  "name": "update_document",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
    "reference": "APP-20418-PAY-10",
    "metadata": {
      "transaction": {
        "loan_amount": 285000,
        "currency": "EUR"
      }
    }
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.update("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", {
  reference: "APP-20418-PAY-10",
  metadata: { transaction: { loan_amount: 285000, currency: "EUR" } },
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.update(
    "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
    reference="APP-20418-PAY-10",
    metadata={"transaction": {"loan_amount": 285000, "currency": "EUR"}},
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.Update(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", &kontiga.DocumentsUpdateParams{
	Reference: "APP-20418-PAY-10",
	Metadata:  map[string]any{"transaction": map[string]any{"loan_amount": 285000, "currency": "EUR"}},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().update("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", DocumentsUpdateParams.builder()
    .reference("APP-20418-PAY-10")
    .metadata(Map.of("transaction", Map.of("loan_amount", 285000, "currency", "EUR")))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.UpdateAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", new DocumentsUpdateOptions
{
    Reference = "APP-20418-PAY-10",
    Metadata = new Dictionary<string, object> { ["transaction"] = new Dictionary<string, object> { ["loan_amount"] = 285000, ["currency"] = "EUR" } },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->update('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e', [
    'reference' => 'APP-20418-PAY-10',
    'metadata' => ['transaction' => ['loan_amount' => 285000, 'currency' => 'EUR']],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.update(
  "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  reference: "APP-20418-PAY-10",
  metadata: { transaction: { loan_amount: 285000, currency: "EUR" } }
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .update("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into(), kontiga::documents::UpdateParams {
        reference: "APP-20418-PAY-10".into(),
        metadata: serde_json::json!({"transaction":{"loan_amount":285000,"currency":"EUR"}}),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_details",
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "reference": "APP-20418-PAY-10",
  "compatible_id": { "submission_id": "document_1Kq8Vd3Xr5Tn2Bw7Ys9Hc4", "request_id": "M2URN5KEF" },
  "country": { "code": "IE", "name": "Ireland" },
  "workspace": { "id": "ws_0193c1a2b3c44d5e8f60718293a4b5c6", "name": "Harbourline Lending", "region": "eu-west-1" },
  "received_from": { "kind": "person", "name": "Marta Kowalczyk" },
  "file": {
    "name": "payslip-oct-2026.pdf",
    "content_type": "application/pdf",
    "pages": 1,
    "sha256": "9f2c4e7a1b3d58c06e2f9a4b7d1c3e5f80a2b4c6d8e0f1a3b5c7d9e1f2a4b6c8"
  },
  "metadata": {
    "transaction": { "loan_amount": 285000, "currency": "EUR" }
  }
}
```

## Download the original file

The file exactly as it was received: the customer's own bytes, as the end customer sent them.

`GET /v1/documents/{document_id}/file`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents download <document_id> [--output <path>]`. MCP tool: `download_document`.

**Parameters**
- `document_id` (id (doc_), required): The document whose file to download. The answer is the file itself, exactly as it was received, with its own content type. Send `Accept: application/json` for a link to it instead, which lives 5 minutes. In the path.

**Returns** file: The original file, with its own content type (PDF, JPEG, PNG or HEIC).

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/file \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents download doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `download_document`:

```json
{
  "name": "download_document",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.downloadOriginal("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.download_original("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.DownloadOriginal(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().downloadOriginal("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.DownloadOriginalAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->downloadOriginal('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.download_original("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .download_original("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "url": "https://files.kontiga.com/ws_0193c1a2b3c44d5e8f60718293a4b5c6/payslip-oct-2026.pdf?X-Amz-Expires=300&X-Amz-Signature=8c1f0e",
  "file_name": "payslip-oct-2026.pdf",
  "content_type": "application/pdf",
  "expires_at": "2026-11-27T10:46:09Z"
}
```

## Download the document report

The document's report as a PDF: the verdict, both scores, the total of checks with how many passed and how many found something, every finding by kind with what was found and where, the file's details, and the fields read.

`GET /v1/documents/{document_id}/report`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents report <document_id> [--output <path>]`. MCP tool: `get_document_report`.

**Parameters**
- `document_id` (id (doc_), required): The document whose report to download. The answer is a PDF stating the verdict, both scores, the total of checks with how many passed and found something (the same total as Read a document's checks), each finding, the known outcome and the type's correction, the file's details and the fields read. It is made again whenever one of these changes. Send `Accept: application/json` for a link to it instead, which lives 5 minutes. A document still being checked answers `409`; on the free start the report shows once a plan starts (`403 plan_required`). In the path.

**Returns** file: The document report, a PDF.

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/report \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents report doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `get_document_report`:

```json
{
  "name": "get_document_report",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.downloadReport("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.download_report("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.DownloadReport(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().downloadReport("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.DownloadReportAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->downloadReport('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.download_report("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .download_report("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "url": "https://files.kontiga.com/ws_0193c1a2b3c44d5e8f60718293a4b5c6/report-5f2a9c1e7b3d4a60.pdf?X-Amz-Expires=300&X-Amz-Signature=41d7a2",
  "file_name": "payslip-oct-2026 report.pdf",
  "content_type": "application/pdf",
  "expires_at": "2026-11-27T10:46:09Z"
}
```

## Read a document's known outcome

What a member recorded the document turned out to be (confirmed fraud or genuine), why, who and when; null when nothing is recorded.

`GET /v1/documents/{document_id}/outcome`. Who may: Owner, Admin, Analyst and Viewer; Developer in test mode. CLI: `kontiga documents get-outcome <document_id>`. MCP tool: `get_document_outcome`.

**Parameters**
- `document_id` (id (doc_), required): The document whose known outcome to read. In the path.

**Returns** document outcome: The document's known outcome, with the reason for fraud when given, who recorded it and when, or null.

API:

```bash
curl -X GET https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/outcome \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents get-outcome doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `get_document_outcome`:

```json
{
  "name": "get_document_outcome",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.getOutcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.get_outcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.GetOutcome(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().getOutcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.GetOutcomeAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->getOutcome('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.get_outcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .get_outcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into())
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_outcome",
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "outcome": {
    "value": "confirmed_fraud",
    "reason": "manipulated",
    "recorded_by": "Ines Moreau",
    "recorded_at": "2026-11-26T08:39:44Z"
  },
  "history": [
    { "value": "genuine", "reason": null, "recorded_by": "Ines Moreau", "recorded_at": "2026-11-25T16:12:03Z" },
    { "value": "confirmed_fraud", "reason": "manipulated", "recorded_by": "Ines Moreau", "recorded_at": "2026-11-26T08:39:44Z" }
  ]
}
```

## Record a known outcome

Mark a document confirmed fraud or genuine, or clear the mark; for fraud, optionally say why. It is kept with who and when, and later checks learn from it; the verdict and the scores stay as the checks found them.

`POST /v1/documents/{document_id}/outcome`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga documents outcome <document_id> --outcome <confirmed_fraud|genuine|none> [--reason <known_fraud|false_content|manipulated|ai_generated>]`. MCP tool: `record_document_outcome`.

**Parameters**
- `document_id` (id (doc_), required): The document. In the path.
- `outcome` (enum, required): What it turned out to be, or `null` to clear it. Every version is kept with who recorded it and when, and the latest counts; recording the outcome it has already adds nothing. The verdict and the scores stay as the checks found them. One of `confirmed_fraud`, `genuine`. `null` clears it.
- `reason` (enum, default null): For fraud only: `known_fraud` (known to have been used for fraud before), `false_content` (what it says is false), `manipulated` (changed from the original) or `ai_generated` (made with an AI tool). `null` clears it.

**Returns** document outcome: The document's known outcome, with the reason for fraud when given, who recorded it and when, or null once cleared.

API:

```bash
curl -X POST https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/outcome \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "outcome": "confirmed_fraud",
    "reason": "manipulated"
  }'
```

CLI:

```bash
kontiga documents outcome doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e \
  --outcome confirmed_fraud \
  --reason manipulated
```

MCP tool `record_document_outcome`:

```json
{
  "name": "record_document_outcome",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
    "outcome": "confirmed_fraud",
    "reason": "manipulated"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.recordOutcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", {
  outcome: "confirmed_fraud",
  reason: "manipulated",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.record_outcome(
    "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
    outcome="confirmed_fraud",
    reason="manipulated",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.RecordOutcome(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", &kontiga.DocumentsRecordOutcomeParams{
	Outcome: "confirmed_fraud",
	Reason:  "manipulated",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().recordOutcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", DocumentsRecordOutcomeParams.builder()
    .outcome("confirmed_fraud")
    .reason("manipulated")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.RecordOutcomeAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", new DocumentsRecordOutcomeOptions
{
    Outcome = "confirmed_fraud",
    Reason = "manipulated",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->recordOutcome('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e', [
    'outcome' => 'confirmed_fraud',
    'reason' => 'manipulated',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.record_outcome(
  "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  outcome: "confirmed_fraud",
  reason: "manipulated"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .record_outcome("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into(), kontiga::documents::RecordOutcomeParams {
        outcome: "confirmed_fraud".into(),
        reason: "manipulated".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_outcome",
  "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "outcome": {
    "value": "confirmed_fraud",
    "reason": "manipulated",
    "recorded_by": "Ines Moreau",
    "recorded_at": "2026-11-26T08:39:44Z"
  },
  "history": [
    { "value": "genuine", "reason": null, "recorded_by": "Ines Moreau", "recorded_at": "2026-11-25T16:12:03Z" },
    { "value": "confirmed_fraud", "reason": "manipulated", "recorded_by": "Ines Moreau", "recorded_at": "2026-11-26T08:39:44Z" }
  ]
}
```

## Delete a document

Delete a document checked on its own: its file, its pages, the fields read from it and its results. A record that it existed stays, and so does what the checks learned from it. A document on a case goes with its case, or when its retention period ends.

`DELETE /v1/documents/{document_id}`. Who may: Owner and Admin. CLI: `kontiga documents delete <document_id>`. MCP tool: `delete_document`.

**Parameters**
- `document_id` (id (doc_), required): A document checked on its own. A document on a case is deleted with its case, or when its retention period ends. In the path.

**Returns** deleted document: The document's id, deleted, with its deletion request: read it with deletions.get for what went and what stays.

API:

```bash
curl -X DELETE https://api.kontiga.com/v1/documents/doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga documents delete doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a
```

MCP tool `delete_document`:

```json
{
  "name": "delete_document",
  "arguments": {
    "document_id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.delete("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.delete("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.Delete(ctx, "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().delete("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.DeleteAsync("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->delete('doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.delete("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .delete("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
  "object": "document",
  "deleted": true,
  "deletion": "del_0193f6c9a1b27d3e8f4a5b6c7d8e9f01"
}
```

## Delete several documents

Delete up to 100 documents checked on their own in one call, as the documents list does with the documents chosen. Each one goes as Delete a document says; a document on a case is refused and named with why, and the rest are still deleted.

`POST /v1/documents/delete`. Who may: Owner and Admin. CLI: `kontiga documents delete-many --document-ids <document_id>,...`. MCP tool: `delete_documents`.

**Parameters**
- `document_ids` (array of id (doc_), required): Up to 100 documents. A document on a case is refused and named in `refused` with why; the others are still deleted.

**Returns** deleted documents: Each document deleted, with its deletion request, and each document refused with why.

API:

```bash
curl -X POST https://api.kontiga.com/v1/documents/delete \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document_ids": [
      "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
      "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
    ]
  }'
```

CLI:

```bash
kontiga documents delete-many \
  --document-ids doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a,doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e
```

MCP tool `delete_documents`:

```json
{
  "name": "delete_documents",
  "arguments": {
    "document_ids": [
      "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a",
      "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"
    ]
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.deleteMany({
  document_ids: ["doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a", "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.delete_many(document_ids=["doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a", "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"])
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.DeleteMany(ctx, &kontiga.DocumentsDeleteManyParams{
	DocumentIds: []string{"doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a", "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().deleteMany(DocumentsDeleteManyParams.builder()
    .documentIds(List.of("doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a", "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.DeleteManyAsync(new DocumentsDeleteManyOptions
{
    DocumentIds = new[] { "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a", "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e" },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->deleteMany([
    'document_ids' => ['doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a', 'doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e'],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.delete_many(document_ids: ["doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a", "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e"])
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .delete_many(kontiga::documents::DeleteManyParams {
        document_ids: vec!["doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a".into(), "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into()],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "object": "document_deletions",
  "deleted": [
    { "id": "doc_0193f6b8e1a47c2d9b3f5a6e7d8c9b0a", "object": "document", "deleted": true, "deletion": "del_0193f6c9a1b27d3e8f4a5b6c7d8e9f01" }
  ],
  "refused": [
    { "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", "reason": "It was not found in this workspace." }
  ]
}
```

## Correct a document's type

Say what a document really is when it was read as another type. The correction is kept with who made it and when; the values are read again for the type, and the fraud score and verdict follow. What the document was found to be altered or generated stays as it was.

`POST /v1/documents/{document_id}/type`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga documents correct-type <document_id> --type <type>`. MCP tool: `correct_document_type`.

**Parameters**
- `document_id` (id (doc_), required): A checked document read as another type. One still being checked, or whose checks stopped, answers `409`. In the path.
- `type` (string, required): What it really is, as the document's `type` names it: `payslip`, `bank_statements`, `invoice`. The correction is kept with who made it and when; the values are read again for it and the fraud score and verdict follow, while the risk score and the findings stay as the checks found them.

**Returns** document: The document with its type corrected, its values being read again.

API:

```bash
curl -X POST https://api.kontiga.com/v1/documents/doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e/type \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "payslip"
  }'
```

CLI:

```bash
kontiga documents correct-type doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e \
  --type payslip
```

MCP tool `correct_document_type`:

```json
{
  "name": "correct_document_type",
  "arguments": {
    "document_id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
    "type": "payslip"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.correctType("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", {
  type: "payslip",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.correct_type("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", type="payslip")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.CorrectType(ctx, "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", &kontiga.DocumentsCorrectTypeParams{
	Type: "payslip",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().correctType("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", DocumentsCorrectTypeParams.builder()
    .type("payslip")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.CorrectTypeAsync("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", new DocumentsCorrectTypeOptions
{
    Type = "payslip",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->correctType('doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e', [
    'type' => 'payslip',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.correct_type("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e", type: "payslip")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .correct_type("doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e".into(), kontiga::documents::CorrectTypeParams {
        r#type: "payslip".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "object": "document",
  "mode": "live",
  "case_id": "case_7Kq2Xw9",
  "person_id": "per_2Nc6Qs8",
  "type": "payslip",
  "type_label": "Payslip",
  "title": "Payslip, October 2026",
  "file_name": "payslip-oct-2026.pdf",
  "issuer": "Dunmore Freight Ltd",
  "category": "income",
  "source": "portal",
  "pages": 1,
  "received_at": "2026-11-24T09:31:20Z",
  "state": "checked",
  "stage": "done",
  "check": null,
  "risk_score": 46,
  "fraud_score": 31,
  "fraud_score_reason": null,
  "verdict": "review",
  "verdict_reason": null,
  "findings": [
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051",
      "kind": "fraud",
      "title": "The net pay was changed after the payslip was made",
      "where": "Page 1, the marked area",
      "page": 1,
      "detail": "The net pay reads 3,412.50. The payslip was issued with 2,912.50.",
      "box": { "x": 0.62, "y": 0.71, "w": 0.24, "h": 0.04 },
      "reviewed": false
    },
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e00a4",
      "kind": "positive",
      "title": "Matches genuine payslips from this employer",
      "where": "The whole document",
      "page": 1,
      "detail": "It matches genuine payslips from Dunmore Freight Ltd.",
      "box": { "x": 0, "y": 0, "w": 1, "h": 1 },
      "reviewed": false
    }
  ],
  "fields": [
    { "name": "employee_name", "value": "Marta Kowalczyk", "confidence": 0.99 },
    { "name": "employer_name", "value": "Dunmore Freight Ltd", "confidence": 0.98 },
    { "name": "pay_date", "value": "2026-10-31", "confidence": 0.97 },
    { "name": "net_pay", "value": "3412.50", "confidence": 0.95 }
  ],
  "amount": { "label": "Net pay", "value": 3412.5, "currency": "EUR" },
  "policy_findings": [],
  "reference": "APP-20418-PAY-10",
  "checked_at": "2026-11-24T09:31:58Z"
}
```

## Bring in a document checked on the site

Bring a document checked on Kontiga's site before the account existed into this workspace, with the token the site kept. It shows as checked and counts as the free start's first document.

`POST /v1/documents/import`. Who may: Owner, Admin and Analyst; Developer in test mode. CLI: `kontiga documents import --token <token>`. MCP tool: `import_site_document`.

**Parameters**
- `token` (string, required): The token the site kept when the visitor checked the document, good for 48 hours. It claims once.

**Returns** document: The document, now this workspace's, with its result.

API:

```bash
curl -X POST https://api.kontiga.com/v1/documents/import \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29"
  }'
```

CLI:

```bash
kontiga documents import \
  --token Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29
```

MCP tool `import_site_document`:

```json
{
  "name": "import_site_document",
  "arguments": {
    "token": "Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29"
  }
}
```

TypeScript:

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

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.documents.import({
  token: "Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.documents.import_(token="Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Documents.Import(ctx, &kontiga.DocumentsImportParams{
	Token: "Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.documents().import_(DocumentsImportParams.builder()
    .token("Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Documents.ImportAsync(new DocumentsImportOptions
{
    Token = "Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->documents->import([
    'token' => 'Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.documents.import(token: "Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .documents()
    .import(kontiga::documents::ImportParams {
        token: "Qm9vZ2llV29vZ2llQm9vZ2llV29vZ2llQm9vZ2llV29".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "doc_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e",
  "object": "document",
  "mode": "live",
  "case_id": "case_7Kq2Xw9",
  "person_id": "per_2Nc6Qs8",
  "type": "payslip",
  "type_label": "Payslip",
  "title": "Payslip, October 2026",
  "file_name": "payslip-oct-2026.pdf",
  "issuer": "Dunmore Freight Ltd",
  "category": "income",
  "source": "portal",
  "pages": 1,
  "received_at": "2026-11-24T09:31:20Z",
  "state": "checked",
  "stage": "done",
  "check": null,
  "risk_score": 46,
  "fraud_score": 31,
  "fraud_score_reason": null,
  "verdict": "review",
  "verdict_reason": null,
  "findings": [
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e0051",
      "kind": "fraud",
      "title": "The net pay was changed after the payslip was made",
      "where": "Page 1, the marked area",
      "page": 1,
      "detail": "The net pay reads 3,412.50. The payslip was issued with 2,912.50.",
      "box": { "x": 0.62, "y": 0.71, "w": 0.24, "h": 0.04 },
      "reviewed": false
    },
    {
      "id": "tag_0193f6a2c5e27b3a9d4e1f6a7b8c9d0e00a4",
      "kind": "positive",
      "title": "Matches genuine payslips from this employer",
      "where": "The whole document",
      "page": 1,
      "detail": "It matches genuine payslips from Dunmore Freight Ltd.",
      "box": { "x": 0, "y": 0, "w": 1, "h": 1 },
      "reviewed": false
    }
  ],
  "fields": [
    { "name": "employee_name", "value": "Marta Kowalczyk", "confidence": 0.99 },
    { "name": "employer_name", "value": "Dunmore Freight Ltd", "confidence": 0.98 },
    { "name": "pay_date", "value": "2026-10-31", "confidence": 0.97 },
    { "name": "net_pay", "value": "3412.50", "confidence": 0.95 }
  ],
  "amount": { "label": "Net pay", "value": 3412.5, "currency": "EUR" },
  "policy_findings": [],
  "reference": "APP-20418-PAY-10",
  "checked_at": "2026-11-24T09:31:58Z"
}
```
