# Check a code (/api/checkVerification)

A matching code approves the verification and is used up. Five wrong
codes fail it. A code past its `ttl` is refused with
`verification_expired`.

Endpoint: POST /api/v1/verifications/{id}/check
Full URL: https://app.sendkuy.com/api/v1/verifications/{id}/check
- path parameter id (required): string — The prefixed id of the object.
- header parameter Idempotency-Key (optional): string — Any unique string, one per logical request. Retrying with the same key returns the first answer instead of doing the work twice, and answers with `Idempotent…
Request body (JSON, required); required fields: code
Example "The code the person typed": {"code":"123456"}
Success status: 200

cURL:

```bash
curl -X POST https://app.sendkuy.com/api/v1/verifications/vrf_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3/check \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "123456"
}'
```

Node.js:

```ts
import { SendKuy } from 'sendkuy';

const sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

const result = await sendkuy.verifications.check('vrf_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3', {
  code: '123456',
});
```

PHP:

```php
<?php

use SendKuy\SendKuy;

$sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

$result = $sendkuy->verifications()->check('vrf_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3', [
    'code' => '123456',
]);
```

Python:

```python
import requests

response = requests.request(
    "POST",
    "https://app.sendkuy.com/api/v1/verifications/vrf_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3/check",
    headers={"Authorization": "Bearer sk_live_YOUR_API_KEY"},
    json={
        "code": "123456"
    },
)

data = response.json()["data"]
```