# Send a verification code

Sends a verification code.

```http
POST https://api.pozy.ai/v1/verify/verifications
```

- Area: Messaging / Verify
- Auth: Authorization: Bearer pz_live_...
- Not available yet: calls return 403 feature_not_available

## Request body

Content type: `application/json`

- `channel`, string, required: One of `sms`, `whatsapp`
- `to`, string, required
- `from`, string
- `brandName`, string: Up to 30 characters
- `codeLength`, integer: Default `6`. 4 to 8
- `ttlMinutes`, integer: Default `10`. 1 to 15

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/verify/verifications" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channel": "sms",
  "to": "+14155550123"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/verify/verifications", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    channel: "sms",
    to: "+14155550123"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/verify/verifications",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "channel": "sms",
        "to": "+14155550123",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `id`, string
- `status`, string: One of `pending`, `approved`, `expired`, `max_attempts_reached`, `canceled`, `delivery_failed`
- `channel`, string: One of `sms`, `whatsapp`
- `to`, string
- `expiresAt`, string (date-time)
- `attempts`, integer
- `maxAttempts`, integer
- `sendCount`, integer
- `lastSentAt`, string (date-time): Can be null
- `deliveryStatus`, string: One of `delivered`, `read`, `failed`. Can be null
- `deliveryErrorCode`, integer: Can be null
- `createdAt`, string (date-time)
- `resend`, boolean

```json
{
  "id": "6bfebd43ddc270f6d2c56fc5",
  "status": "pending",
  "channel": "sms",
  "to": "+14155550123",
  "expiresAt": "2026-10-02T09:00:00.000Z",
  "attempts": 1,
  "maxAttempts": 1,
  "sendCount": 42,
  "lastSentAt": "2026-10-02T09:00:00.000Z",
  "deliveryStatus": "delivered",
  "deliveryErrorCode": 1,
  "createdAt": "2026-10-02T09:00:00.000Z",
  "resend": true
}
```
