# Send and verify an OTP

Request a code server-side and associate the verification ID with the user session. Reuse it for verification and resend.

Required. Send the account API key in the X-API-Key header. Never expose the key in a public browser or git repository.

1. POST /api/v2/verification/send with to (optional channel=int_sms).

2. Store verificationId in the user session.

3. After the user types the code: POST /api/v2/verification/verify.

4. If the code does not arrive, wait for resendAvailableAt then call /resend.

## Request preview

```bash
curl --request POST 'https://raselsms.com/api/v2/verification/send' \
  -H "X-API-Key: $RASEL_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'RASEL_JSON'
{
  "to": "+963912345678",
  "channel": "int_sms"
}
RASEL_JSON
```

## HTTP 200

```json
{
  "verificationId": "6800abc123def4567890fedc",
  "status": "sent",
  "channel": "int_sms",
  "expiresAt": "2026-09-05T10:10:00.000Z",
  "resendAvailableAt": "2026-09-05T10:01:00.000Z",
  "resendCount": 0
}
```

Test locally with a mock response first. Confirm the recipient and cost before sending a live request.

- [POST /api/v2/verification/verify](https://raselsms.com/api-docs/markdown/verification/verify.md)

- [POST /api/v2/verification/resend](https://raselsms.com/api-docs/markdown/verification/resend.md)

## HTTP 400

Values such as sms, whatsapp, or auto alone are rejected.

```json
{
  "success": false,
  "code": "VALIDATION_ERROR",
  "error": "Unsupported verification channel"
}
```

[API reference](https://raselsms.com/api-docs/markdown/verification/send.md)

[OpenAPI](https://raselsms.com/api-docs/openapi.json)
