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

# Check a selfie for liveness

POST https://sandbox-api.toden.co/api/v1/checks/liveness
Content-Type: application/json

Checks one selfie for liveness: whether the face in it is a real person in front of the camera, or a printed photo or a screen held up to it. Upload the photo first with `POST /api/kyc/upload` (multipart, `type` `selfie`, JPEG, PNG or WebP), then send the `mediaId` it returns as `selfieMediaId` within 30 minutes. The upload must be your own, in the same environment, and not already used by a verification.

Toden's passive liveness model reads the face, as it reads a verification's selfie. The phone detector looks for a phone touching the face, and the photo is measured for glare, a screen-like pattern, straight edges framing the face, focus, light and how the face is turned.

A single still is weaker evidence than a live capture. A verification also scores a short clip and can ask for head movements, which a photo cannot show, so a good print or a high-quality screen can pass a photo check that a live capture would catch. Use this check to screen a photo you already hold, not in place of liveness on a live capture.

The outcome is `pass` when the model reads a live face, `fail` when it reads an attack below the confident-attack line, and `review` for an attack above that line or a phone seen touching the face. A photo with no face, or a deployment that cannot run the model, is `unavailable` (`failureCode` `no_face` or `model_unavailable`) and is not charged.

Outside production the model runs for real on your photo, at no charge. There are no test photos with fixed answers.

Rules: send `rules` to set what each finding does (`decline` fails the check, `review` sends it to review, `approve` keeps it as a note and passes) and to change the check's settings. Anything left out takes your organisation's saved default rules (set in Spot Checks), else Toden's, which judge the check as it was judged before rules existed. `result.rules` says which rules the check ran under, where each came from and what each finding did.

Charged per check at your price (production only); a check that could not be completed is not charged. Send a `requestId`: a retry with the same value returns the same check with `replayed: true`, without running or charging again.

**Error codes**

| `error` | Status | Meaning |
|---|---|---|
| `invalid_input` | 400 | The body is missing something the check needs, or the requestId is malformed. |
| `insufficient_credits` | 402 | Your balance cannot cover the check. Nothing was run or charged. |
| `checks_unavailable` | 403 | These checks are not switched on for your organisation yet. |
| `spot_checks_disabled` | 403 | Spot checks are not enabled for your organisation. |
| `request_id_reused` | 409 | The requestId was used for a different check. |
| `check_in_progress` | 409 | A check with this requestId is still running. |
| `file_not_found` | 422 | The uploaded file was not found, is not yours, or has expired. |
| `check_unavailable` | 503 | The check cannot run on this deployment right now. Nothing was charged. |
| `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/create-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

### Body (application/json)

This endpoint expects a LivenessCheckRequest.

- `selfieMediaId` (string, required) — The `mediaId` returned by `POST /api/kyc/upload` with `type` `selfie`. Uploads last 30 minutes.
- `externalUserId` (string, optional) — Your own reference for the check (a customer or case id), kept with it and searchable in your history.
- `rules` (LivenessCheckRequestRules, optional) — What each finding does, and where the lines sit on the 1 to 100 score. Defaults: `confident_attack` decline, `attack` and `phone_in_view` review, lines at 20 and 50. Our scale is not another provider's: read `result.modelScore` to set a line.
- `requestId` (string, optional) — Your idempotency key, 8 to 120 characters: a retry with the same value returns the same check.

## Response

### 200

A retry: the check already run under this requestId.

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

### 201

The check was run.

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

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

### 402 Payment Required Error

The organisation does not have enough credit for this request.

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

### 409 Conflict Error

The request conflicts with the current state of the resource.

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

### 422 Unprocessable Entity Error

The request was understood but cannot be processed as sent.

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

### 503 Service Unavailable Error

The service is temporarily unavailable.

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

### LivenessCheckRequestRules

What each finding does, and where the lines sit on the 1 to 100 score. Defaults: `confident_attack` decline, `attack` and `phone_in_view` review, lines at 20 and 50. Our scale is not another provider's: read `result.modelScore` to set a line.

- `confident_attack` (enum, optional) — The model's score is under `declineBelow`.
  - Allowed values: `decline`, `review`, `approve`
- `attack` (enum, optional) — The model's score is under `reviewBelow` but not under `declineBelow`.
  - Allowed values: `decline`, `review`, `approve`
- `phone_in_view` (enum, optional) — A phone seen touching the face, where the phone check acts.
  - Allowed values: `decline`, `review`, `approve`
- `declineBelow` (integer, optional) — Under this model score the face is a confident attack. Default 20.
- `reviewBelow` (integer, optional) — Under this model score the face is an attack. Default 50; at or above `declineBelow`.
- `rotate` (boolean, optional) — Turn a sideways photo upright before reading it: its EXIF orientation, then quarter turns while no face is found. Default false.

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

### Example 1

**Request**

```json
{
  "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
  "requestId": "liveness-7f3a2c91"
}
```

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

payload = {
    "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
    "requestId": "liveness-7f3a2c91"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/liveness';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"selfieMediaId":"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f","requestId":"liveness-7f3a2c91"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}"

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.post("https://sandbox-api.toden.co/api/v1/checks/liveness")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/checks/liveness', [
  'body' => '{
  "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
  "requestId": "liveness-7f3a2c91"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/liveness");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
  "requestId": "liveness-7f3a2c91"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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

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

### Example 2

**Request**

```json
{
  "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
  "requestId": "liveness-7f3a2c91"
}
```

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

payload = {
    "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
    "requestId": "liveness-7f3a2c91"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/checks/liveness';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"selfieMediaId":"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f","requestId":"liveness-7f3a2c91"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}"

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.post("https://sandbox-api.toden.co/api/v1/checks/liveness")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/checks/liveness', [
  'body' => '{
  "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
  "requestId": "liveness-7f3a2c91"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/checks/liveness");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"selfieMediaId\": \"med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f\",\n  \"requestId\": \"liveness-7f3a2c91\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "selfieMediaId": "med_3f1c9a7e5b2d4c6a8e0f1b3d5c7a9e2f",
  "requestId": "liveness-7f3a2c91"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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

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