> Toden documentation. For the full index fetch /llms.txt. Every page is available as Markdown by appending .md to its URL. Every endpoint is under /api/v1. Identity verification and Risk Intelligence are separate contracts there with different error shapes; /api/kyc and /api/identity are older prefixes that still answer the same. Never invent an endpoint, field or enum value: read the API reference page for the operation first.

# List document checks

GET https://sandbox-api.toden.co/api/v1/checks/document

Your document checks in this environment, newest first.

Requires a secret (`sk_`) key. A publishable key receives `403 secret_key_required`.

Reference: https://docs.toden.co/api-reference/verification/standalone-checks/list-document-checks

## Authentication

- `Authorization` header (bearer token, required) — Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required. A scoped publishable key has Verification flow access, the fixed set `flow.run`, `flow.config.read` and `verifications.status.read`; a scoped secret key reaches what its scopes allow.

## Servers

- `https://sandbox-api.toden.co` (Sandbox, default)
- `https://api.toden.co` (Production)

## Request

### Query parameters

- `outcome` (enum, optional) — Only checks with this outcome.
  - Allowed values: `pass`, `review`, `fail`, `unavailable`
- `page` (integer, optional, default: 1) — The page to return.
- `pageSize` (integer, optional, default: 25) — Checks per page.

## Response

### 200

One page of checks.

- `data` (list of DocumentCheck, required)
- `total` (integer, required) — How many records match the filters across every page.
- `page` (integer, required) — The page that was returned.
- `pageSize` (integer, required) — The page size that was applied.

## Errors

### 400 Bad Request Error

The request body, query or path was invalid.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 401 Unauthorized Error

The Authorization header is missing, or the API key is unknown or revoked.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

### 403 Forbidden Error

The key may not call this endpoint, or the organisation may not use this feature.

- `error` (string, required) — A stable machine-readable code such as `invalid_input`. Authentication failures (401) carry a short sentence here instead of a code.
- `message` (string, optional) — A human-readable explanation, safe to log. The wording may change.

## Types

### DocumentCheck

- `id` (string, required) — The check id (`chk_…`).
- `kind` (enum, required) — Which check this is.
  - Allowed values: `document`
- `outcome` (enum, required) — `pass`: nothing of concern. `review`: something a person should look at. `fail`: a clear problem. `unavailable`: the check could not be completed, was not charged, and is never a pass.
  - Allowed values: `pass`, `review`, `fail`, `unavailable`
- `subject` (string, required) — What was checked, as your history lists it.
- `channel` (enum, required) — Whether the check was run through the API or from the dashboard.
  - Allowed values: `api`, `dashboard`
- `createdAt` (datetime, required) — When the check was run.
- `input` (DocumentCheckInput, optional) — What was sent, minimised: never image bytes, only media ids.
- `externalUserId` (string, optional, nullable) — Your own reference for the check, as sent.
- `result` (DocumentCheckResult, optional, nullable) — What was found. Null when the check could not be completed.
- `failureCode` (string, optional, nullable) — Why the check could not be completed, when `outcome` is `unavailable`.
- `charged` (string, optional, nullable) — What the check cost in USD, as a decimal string. Null when nothing was charged.
- `entityId` (string, optional, nullable) — The customer record this check was saved to.
- `completedAt` (datetime, optional, nullable) — When it finished.
- `replayed` (boolean, optional) — On a run only: true when this is a check already run under the same `requestId`.

### DocumentCheckInput

What was sent, minimised: never image bytes, only media ids.

### DocumentCheckResult

What was found. Null when the check could not be completed.

- `sample` (boolean, optional) — True in sandbox: the document was not read and every value is a sample.
- `frontMediaId` (string, optional) — The uploaded front checked.
- `backMediaId` (string, optional, nullable) — The uploaded back checked, when one was sent.
- `reasons` (list of enum, optional) — Why the check is not a pass; empty on a pass.
  - Allowed values: `invalid_mrz`, `expiry_not_detected`, `expired`, `inconsistent_data`, `document_liveness`, `template_mismatch`, `under_minimum_age`
- `notes` (list of enum, optional) — What was found but approved by the rules.
  - Allowed values: `invalid_mrz`, `expiry_not_detected`, `expired`, `inconsistent_data`, `document_liveness`, `template_mismatch`, `under_minimum_age`
- `documentKind` (enum, optional) — What the document was recognised as.
  - Allowed values: `passport`, `drivers_license`, `national_id`, `voter_card`, `residence_permit`, `other`
- `issuingCountry` (string, optional, nullable) — The country that issued it, as read (or the `country` sent).
- `fields` (DocumentCheckResultFields, optional) — What was read. The document's own code (MRZ or barcode) wins over the printed text where both have a field.
- `sources` (map from string to enum, optional) — Where each field read came from.
  - Allowed values: `barcode`, `mrz`, `printed`
- `mrz` (DocumentCheckResultMrz, optional)
- `barcode` (boolean, optional) — A barcode was decoded and read.
- `inconsistencies` (list of DocumentCheckResultInconsistenciesItems, optional) — Where the printed text and the document's own code disagree.
- `age` (integer, optional, nullable) — Whole years, from the date of birth. Null when it was not read.
- `expired` (boolean, optional, nullable) — Null when no expiry date was read.
- `minimumAge` (integer, optional, nullable) — The `minimumAge` the check was judged against.
- `documentLiveness` (DocumentCheckResultDocumentLiveness, optional) — What examining the document itself found.
- `templateIssues` (list of string, optional) — What does not fit the document's kind, in a few words each.
- `checkedAt` (datetime, optional) — When the document was judged.
- `rules` (DocumentCheckResultRules, optional) — The rules this check was judged by.

### DocumentCheckResultFields

What was read. The document's own code (MRZ or barcode) wins over the printed text where both have a field.

- `documentNumber` (string, optional, nullable) — The document number.
- `lastName` (string, optional, nullable) — The surname.
- `firstName` (string, optional, nullable) — The first given name.
- `middleName` (string, optional, nullable) — Any further given names.
- `dateOfBirth` (date, optional, nullable) — The date of birth (YYYY-MM-DD).
- `expiryDate` (date, optional, nullable) — The expiry date (YYYY-MM-DD).
- `issueDate` (date, optional, nullable) — The issue date (YYYY-MM-DD).
- `sex` (string, optional, nullable) — M or F.
- `nationality` (string, optional, nullable) — The nationality, as the MRZ gives it (ISO 3166-1 alpha-3).

### DocumentCheckResultMrz

- `found` (boolean, optional)
- `valid` (boolean, optional) — Its ICAO check digits hold.
- `format` (enum, optional) — TD1 (ID cards) or TD3 (passports).
  - Allowed values: `TD1`, `TD3`

### DocumentCheckResultInconsistenciesItems

- `field` (string, optional) — The field.
- `printed` (string, optional) — As printed.
- `machineReadable` (string, optional) — As the code gives it.

### DocumentCheckResultDocumentLiveness

What examining the document itself found.

- `status` (enum, optional) — `not_checked`: switched off, or read by a reader that cannot examine it.
  - Allowed values: `clean`, `concerns`, `not_checked`
- `capture` (enum, optional) — How the image was made.
  - Allowed values: `paper_photo`, `screen_photo`, `screenshot`, `scan`, `photocopy`, `pdf_render`, `other`
- `portraitReplaced` (boolean, optional, nullable)
- `signs` (list of string, optional) — What looks altered, in a few words each. Never a name, a number or a date.

### DocumentCheckResultRules

The rules this check was judged by.

- `actions` (map from string to enum, optional) — Each finding's action.
  - Allowed values: `decline`, `review`, `approve`
- `settings` (DocumentCheckResultRulesSettings, optional) — Each setting's value.
- `source` (map from string to enum, optional) — Where each finding's action and each setting came from.
  - Allowed values: `default`, `organisation`, `request`
- `triggered` (list of DocumentCheckResultRulesTriggeredItems, optional) — The findings this check found, each with the action it took.

### DocumentCheckResultRulesSettings

Each setting's value.

### DocumentCheckResultRulesTriggeredItems

- `finding` (string, optional) — The finding.
- `action` (enum, optional) — What it did.
  - Allowed values: `decline`, `review`, `approve`

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "string",
      "kind": "document",
      "outcome": "pass",
      "subject": "string",
      "channel": "api",
      "createdAt": "2024-01-15T09:30:00Z",
      "input": {},
      "externalUserId": "string",
      "result": {
        "sample": true,
        "frontMediaId": "string",
        "backMediaId": "string",
        "reasons": [
          "invalid_mrz"
        ],
        "notes": [
          "invalid_mrz"
        ],
        "documentKind": "passport",
        "issuingCountry": "string",
        "fields": {
          "documentNumber": "string",
          "lastName": "string",
          "firstName": "string",
          "middleName": "string",
          "dateOfBirth": "2023-01-15",
          "expiryDate": "2023-01-15",
          "issueDate": "2023-01-15",
          "sex": "string",
          "nationality": "string"
        },
        "sources": {},
        "mrz": {
          "found": true,
          "valid": true,
          "format": "TD1"
        },
        "barcode": true,
        "inconsistencies": [
          {
            "field": "string",
            "printed": "string",
            "machineReadable": "string"
          }
        ],
        "age": 1,
        "expired": true,
        "minimumAge": 1,
        "documentLiveness": {
          "status": "clean",
          "capture": "paper_photo",
          "portraitReplaced": true,
          "signs": [
            "string"
          ]
        },
        "templateIssues": [
          "string"
        ],
        "checkedAt": "2024-01-15T09:30:00Z",
        "rules": {
          "actions": {},
          "settings": {},
          "source": {},
          "triggered": [
            {
              "finding": "string",
              "action": "decline"
            }
          ]
        }
      },
      "failureCode": "string",
      "charged": "string",
      "entityId": "string",
      "completedAt": "2024-01-15T09:30:00Z",
      "replayed": true
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/v1/checks/document"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/document';
const options = {method: 'GET', headers: {Authorization: 'Bearer <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.toden.co/api/v1/checks/document"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.toden.co/api/v1/checks/document")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox-api.toden.co/api/v1/checks/document")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox-api.toden.co/api/v1/checks/document', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/document");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/v1/checks/document")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```