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

# Retrieve a liveness check

GET https://sandbox-api.toden.co/api/v1/checks/liveness/{id}

**Error codes**

| `error` | Status | Meaning |
|---|---|---|
| `not_found` | 404 | No such check of this kind, or it was deleted. |
| `secret_key_required` | 403 | A publishable key was used. This endpoint accepts secret keys only. |
| `environment_mismatch` | 403 | The key belongs to an environment this deployment does not serve. |
| `ip_not_allowed` | 403 | The key has an IP allowlist and the calling address is not on it. |
| `organization_suspended` | 403 | The organisation is suspended. The response carries `reason` and `suspendedAt`. |
| `business_not_approved` | 403 | A live key was used before the business was approved for production. |

A missing or unknown key answers `401`, where `error` is a short sentence rather than a code.

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

Reference: https://docs.toden.co/api-reference/verification/standalone-checks/get-liveness-check

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

### Path parameters

- `id` (string, required) — The check id, as returned by the run (`chk_…`).

## Response

### 200

The check.

- `id` (string, required) — The check id (`chk_…`).
- `kind` (enum, required) — Which check this is.
  - Allowed values: `liveness`
- `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` (LivenessCheckInput, optional) — What was sent, minimised: never image bytes, only media ids.
- `externalUserId` (string, optional, nullable) — Your own reference for the check, as sent.
- `result` (LivenessCheckResult, 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`.

## Errors

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

### 404 Not Found Error

The resource does not exist for this organisation and environment.

- `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

### LivenessCheckInput

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

### LivenessCheckResult

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

- `verdict` (enum, optional) — The model's own reading: `live` when the real-face probability is at or above `threshold`, `attack` under it.
  - Allowed values: `live`, `attack`
- `confidentAttack` (boolean, optional) — The attack is below the confident-attack line (`attackLine`): the outcome is `fail`.
- `score` (integer, optional) — The liveness score, 1 to 100: higher is more confidently a live person. The same scale a verification shows. It takes the weaker of the model and the phone detector.
- `scoreBands` (LivenessCheckResultScoreBands, optional) — How to read `score`: under `declineBelow` a verification would decline, under `reviewBelow` it is borderline, from `reviewBelow` up it is clear.
- `realProbability` (double, optional) — The model's probability that the face is a real, present face.
- `threshold` (double, optional) — Under this probability the model reads an attack.
- `attackLine` (double, optional) — Under this probability an attack is confident and the check fails.
- `model` (string, optional) — The liveness model's version.
- `faceFound` (boolean, optional) — A face was found. Always true on a result: a photo with no face is `unavailable`.
- `facesInPhoto` (integer, optional, nullable) — The person plus anyone else clearly in the photo.
- `phone` (LivenessCheckResultPhone, optional, nullable) — The phone detector's reading. Null when it could not run on this deployment.
- `signals` (list of string, optional) — Notes on the image for a reviewer, e.g. "Bright glare patch on the face", "Screen-like pattern on the face", "Straight edges framing the face". They inform and never decide the outcome.
- `imageQuality` (LivenessCheckResultImageQuality, optional, nullable) — Whether the photo was good enough to judge. Null when it could not be measured. Informs only.
- `reasons` (list of enum, optional) — Why the outcome is not `pass`: `attack` (an attack above the confident line, review by default), `confident_attack` (fail by default), `phone_in_view` (review by default). Empty on a pass.
  - Allowed values: `attack`, `confident_attack`, `phone_in_view`
- `notes` (list of enum, optional) — What was found but approved by the rules: shown as notes, never a reason it did not pass.
  - Allowed values: `attack`, `confident_attack`, `phone_in_view`
- `modelScore` (integer, optional) — The model's reading alone on the 1 to 100 scale (no phone): what the rules' lines are compared with.
- `lines` (LivenessCheckResultLines, optional) — The lines this check was judged on.
- `rotated` (enum, optional) — How far the photo was turned to read it (`rules.rotate`); null when it was not turned.
  - Allowed values: `0`, `90`, `180`, `270`
- `selfieMediaId` (string, optional) — The selfie that was checked.
- `checkedAt` (datetime, optional) — When the model read the photo.
- `rules` (LivenessCheckResultRules, optional) — The rules this check was judged by.

### LivenessCheckResultScoreBands

How to read `score`: under `declineBelow` a verification would decline, under `reviewBelow` it is borderline, from `reviewBelow` up it is clear.

- `declineBelow` (integer, optional)
- `reviewBelow` (integer, optional)

### LivenessCheckResultPhone

The phone detector's reading. Null when it could not run on this deployment.

- `detected` (boolean, optional) — A phone was seen touching the face, at or above `line`.
- `confidence` (double, optional) — The detector's highest confidence for a phone touching the face.
- `line` (double, optional) — At or above this confidence a phone counts as seen.
- `declineAt` (double, optional, nullable) — At or above this confidence a verification declines. This check holds it for review instead, since a still cannot show the phone being brought up to the camera.
- `acted` (boolean, optional) — Whether the phone check acts on this deployment. When false it is recorded only and does not change the outcome.
- `model` (string, optional) — The phone detector's version.

### LivenessCheckResultImageQuality

Whether the photo was good enough to judge. Null when it could not be measured. Informs only.

- `inFocus` (boolean, optional) — The face is sharp enough.
- `wellLit` (boolean, optional) — The face is neither too dark nor washed out.
- `closeEnough` (boolean, optional) — The face is large enough in the photo.
- `facing` (boolean, optional) — The person faces the camera.
- `wholeFace` (boolean, optional) — The whole face is inside the photo.

### LivenessCheckResultLines

The lines this check was judged on.

- `declineBelow` (integer, optional)
- `reviewBelow` (integer, optional)

### LivenessCheckResultRules

The rules this check was judged by.

- `actions` (map from string to enum, optional) — Each finding's action.
  - Allowed values: `decline`, `review`, `approve`
- `settings` (LivenessCheckResultRulesSettings, 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 LivenessCheckResultRulesTriggeredItems, optional) — The findings this check found, each with the action it took.

### LivenessCheckResultRulesSettings

Each setting's value.

### LivenessCheckResultRulesTriggeredItems

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

## Examples

**Response**

```json
{
  "id": "string",
  "kind": "liveness",
  "outcome": "pass",
  "subject": "string",
  "channel": "api",
  "createdAt": "2024-01-15T09:30:00Z",
  "input": {},
  "externalUserId": "string",
  "result": {
    "verdict": "live",
    "confidentAttack": false,
    "score": 96,
    "scoreBands": {
      "declineBelow": 20,
      "reviewBelow": 50
    },
    "realProbability": 0.968,
    "threshold": 0.5,
    "attackLine": 0.1,
    "model": "minifasnet-v2@2.7+v1se@4.0",
    "faceFound": true,
    "facesInPhoto": 1,
    "phone": {
      "detected": false,
      "confidence": 0.04,
      "line": 0.45,
      "declineAt": 0.6,
      "acted": true,
      "model": "yolox-tiny@coco-67"
    },
    "signals": [],
    "imageQuality": {
      "inFocus": true,
      "wellLit": true,
      "closeEnough": true,
      "facing": true,
      "wholeFace": true
    },
    "reasons": [],
    "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
    "checkedAt": "2026-11-20T10:15:02.000Z"
  },
  "failureCode": "string",
  "charged": "string",
  "entityId": "string",
  "completedAt": "2024-01-15T09:30:00Z",
  "replayed": true
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/liveness/id';
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/liveness/id"

	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/liveness/id")

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/liveness/id")
  .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/liveness/id', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/liveness/id");
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/liveness/id")! 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()
```