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

# Check a one-time code

POST https://sandbox-api.toden.co/api/kyc/contact/verifications/{id}/check
Content-Type: application/json

Checks the code the person typed. A correct code marks the challenge `verified` and returns the record. No proof token is returned, and a contact proved here cannot be carried into a verification submission.

Every call spends one attempt, including a repeat call on a challenge that is already verified. A wrong code answers `400 invalid_code` with `attemptsRemaining`.

**Billing.** The check is charged once, when a code is first accepted, in production only. `chargedAmount` reports the cost. A repeat call does not charge again.

**Error codes**

| `error` | Status | Meaning |
|---|---|---|
| `invalid_request` | 400 | The body failed validation. |
| `invalid_code` | 400 | The code is wrong. `attemptsRemaining` says how many tries are left. |
| `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. |
| `challenge_not_found` | 404 | No challenge with that id for this organisation and environment, or it was not created through this API. |
| `challenge_expired` | 410 | The five minute window has closed. Send a new code. |
| `too_many_attempts` | 429 | The attempt allowance is spent. Send a new code. |

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/contact-verification/check-contact-verification

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

## Servers

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

## Request

### Path parameters

- `id` (string, required) — The contact verification id returned when the code was sent.

### Body (application/json)

This endpoint expects a ContactVerificationCheckRequest.

- `code` (string, required) — The code the person typed.

## Response

### 200

The code was accepted.

- `contactVerification` (ContactVerification, required)

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

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

### 410 Gone Error

The resource has expired.

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

### 429 Too Many Requests Error

A rate limit was reached. Retry after a short wait.

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

### ContactVerification

- `id` (string, required) — The contact verification id.
- `status` (enum, required) — `pending` until a code is accepted, `verified` once one is, and `expired` when the window closes without one.
  - Allowed values: `pending`, `verified`, `expired`
- `channel` (enum, required) — What is being verified.
  - Allowed values: `email`, `phone`
- `destination` (string, required) — The contact in its normalised form: a lowercased email address or an E.164 phone number.
- `attemptsUsed` (integer, required) — How many codes have been checked against this challenge so far.
- `expiresAt` (datetime, required) — When the code stops being accepted, five minutes after it was sent.
- `createdAt` (datetime, required) — When the code was sent.
- `deliveryChannel` (enum, optional) — What carried the code. `test` means nothing was sent, which is every challenge outside production.
  - Allowed values: `email`, `sms`, `whatsapp`, `test`
- `country` (string, optional, nullable) — The ISO 3166-1 alpha-2 country you sent, which the price was resolved against. Null when you sent none.
- `signals` (ContactVerificationSignals, optional, nullable) — What is known about the contact, worked out when the code was sent. An email carries the email fields and a phone carries the phone fields.
- `externalUserId` (string, optional, nullable) — Your own reference for the person, as you sent it.
- `chargedAmount` (string, optional, nullable) — What the completed check cost in USD, as a decimal string. Null until a check completes, and always null outside production.
- `verifiedAt` (datetime, optional, nullable) — When the code was accepted.

### ContactVerificationSignals

What is known about the contact, worked out when the code was sent. An email carries the email fields and a phone carries the phone fields.

- `domain` (string, optional) — Email: the mail domain.
- `disposable` (boolean, optional) — Email: the domain is a known throwaway mailbox service.
- `freeProvider` (boolean, optional) — Email: the domain is a consumer email service.
- `mxFound` (boolean, optional, nullable) — Email: the domain publishes mail servers. Null when the lookup could not answer.
- `e164` (string, optional, nullable) — Phone: the number in E.164 form.
- `country` (string, optional, nullable) — Phone: the ISO 3166-1 alpha-2 country the number belongs to.
- `callingCode` (string, optional, nullable) — Phone: the country calling code, digits only.
- `valid` (boolean, optional) — Phone: the number is a valid number for its country.
- `lineType` (string, optional, nullable) — Phone: the kind of line, for example `mobile`, `fixed_line` or `voip`. Null when it cannot be classified.
- `virtual` (boolean, optional, nullable) — Phone: true only for a known internet telephony range, false for any other known type, null when unknown.

## Examples

**Request**

```json
{
  "code": "000000"
}
```

**Response**

```json
{
  "contactVerification": {
    "id": "cmt8s0a4p0003qw9k2m7f3cv1",
    "status": "verified",
    "channel": "phone",
    "destination": "+2348030000000",
    "attemptsUsed": 1,
    "expiresAt": "2026-09-12T10:05:00.000Z",
    "createdAt": "2026-09-12T10:00:00.000Z",
    "deliveryChannel": "test",
    "country": "NG",
    "signals": {
      "e164": "+2348030000000",
      "country": "NG",
      "callingCode": "234",
      "valid": true,
      "lineType": "mobile",
      "virtual": false
    },
    "externalUserId": "user_8f21",
    "chargedAmount": null,
    "verifiedAt": "2026-09-12T10:01:12.000Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/kyc/contact/verifications/id/check"

payload = { "code": "000000" }
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/kyc/contact/verifications/id/check';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"code":"000000"}'
};

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/kyc/contact/verifications/id/check"

	payload := strings.NewReader("{\n  \"code\": \"000000\"\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/kyc/contact/verifications/id/check")

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  \"code\": \"000000\"\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/kyc/contact/verifications/id/check")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"code\": \"000000\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/kyc/contact/verifications/id/check', [
  'body' => '{
  "code": "000000"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/kyc/contact/verifications/id/check");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"code\": \"000000\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["code": "000000"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/kyc/contact/verifications/id/check")! 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()
```