# Send a one-time code (/api/createVerification)

Creates a code, sends it through the first channel in `channels` that
has a sender, and answers at once. When a WhatsApp device sends it but
no delivery receipt arrives within 30 seconds, or a send fails later,
the same code goes out on the next channel.

Each message spends the credit of its own channel. A channel that is
skipped spends nothing.

Endpoint: POST /api/v1/verifications
Full URL: https://app.sendkuy.com/api/v1/verifications
- 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: none
Example "WhatsApp, then SMS": {"to":"+6281234567890","brand":"Toko Andi"}
Success status: 201

cURL:

```bash
curl -X POST https://app.sendkuy.com/api/v1/verifications \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+6281234567890",
  "brand": "Toko Andi"
}'
```

Node.js:

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

const sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

const result = await sendkuy.verifications.create({
  to: '+6281234567890',
  brand: 'Toko Andi',
});
```

PHP:

```php
<?php

use SendKuy\SendKuy;

$sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

$result = $sendkuy->verifications()->create([
    'to' => '+6281234567890',
    'brand' => 'Toko Andi',
]);
```

Python:

```python
import requests

response = requests.request(
    "POST",
    "https://app.sendkuy.com/api/v1/verifications",
    headers={"Authorization": "Bearer sk_live_YOUR_API_KEY"},
    json={
        "to": "+6281234567890",
        "brand": "Toko Andi"
    },
)

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