/auth/send-otp endpoint.messages:send| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
phone | string | Yes | Phone number that received the OTP | |
code | string | Yes | The OTP code to verify | |
purpose | string | No | max:50 | OTP purpose (default: authentication). Must match the purpose used when sending |
otp-verify:{tenant_id}:{phone}retry_after seconds when limit exceeded| Field | Type | Description |
|---|---|---|
phone | string | Verified phone number |
purpose | string | OTP purpose |
verified_at | string | ISO 8601 verification timestamp |
| Error Code | Description |
|---|---|
OTP_NOT_FOUND | No active OTP for this phone number and purpose |
MAX_ATTEMPTS_EXCEEDED | Too many failed verification attempts (default: 5). Must request new OTP |
OTP_EXPIRED | OTP has passed its expiry time. Must request new OTP |
INVALID_CODE | Wrong code entered. Returns attempts_remaining count |
| Status | Error Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing API token |
| 403 | INSUFFICIENT_SCOPE | Token missing messages:send scope |
| 422 | VALIDATION_ERROR | Request validation failed or OTP verification failed |
| 429 | RATE_LIMIT_EXCEEDED | Too many verification attempts |
| 500 | INTERNAL_ERROR | Unexpected server error |
| Field | Message |
|---|---|
phone | Phone number is required |
code | Verification code is required |
curl --location --request POST '/auth/verify' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"phone": "+919999999999",
"code": "123456",
"purpose": "authentication"
}'{}