> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ondial.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> HTTP status and reasonCode map for /api/v1.

Errors are JSON objects:

```json theme={"system"}
{
  "error": "Consent required for outbound call",
  "reasonCode": "consent_missing"
}
```

## Common reason codes

| Code                                                         | HTTP      | Meaning                                                                   |
| ------------------------------------------------------------ | --------- | ------------------------------------------------------------------------- |
| `unauthorized`                                               | 401       | Missing, bad, or revoked key                                              |
| `api_globally_disabled`                                      | 503       | Kill switch                                                               |
| `rate_limited`                                               | 429       | Per-key limit                                                             |
| `campaign_not_accepting`                                     | 422       | Draft / testing                                                           |
| `campaign_closed`                                            | 422       | Completed / expired / archived                                            |
| `campaign_paused_queued`                                     | 201       | Accepted; dials after resume                                              |
| `insufficient_credits`                                       | 402 / 503 | No credits (402 on `POST /numbers/purchase`; 503 on outbound dial)        |
| `pool_purchase_unavailable`                                  | 422       | Tenant cannot buy pool inventory                                          |
| `numbers_unavailable`                                        | 409       | Number id invalid or already purchased                                    |
| `batch_limit_exceeded`                                       | 400       | Too many numbers in one purchase request                                  |
| `invalid_phone` / `email_required` / `invalid_channel`       | 422       | Channel field validation                                                  |
| `contact_identity_required`                                  | 422       | `channel: none` needs phone or email                                      |
| `dnc_blocked` / `consent_missing`                            | 422       | Call channel only                                                         |
| `whatsapp_unsubscribed`                                      | 422       | STOP list                                                                 |
| `duplicate_no_requeue`                                       | 201       | Same phone already pending                                                |
| `requeue_required`                                           | 422       | Finished contact needs `requeue: true`                                    |
| `followup_already_pending`                                   | 409       | Use `force: true`                                                         |
| `contact_busy`                                               | 422       | Call in progress                                                          |
| `event_unmapped`                                             | 422       | No event route                                                            |
| `not_found`                                                  | 404       | Unknown or not owned                                                      |
| `phone_not_owned`                                            | 422       | Inbound number not yours                                                  |
| `phone_already_configured`                                   | 422       | Inbound agent already exists for this number                              |
| `script_not_ready`                                           | 422       | Inbound script generating/error                                           |
| `appointment_scope_required`                                 | 422       | HMS slots/booking on without `appointmentScope`                           |
| `global_scope_locks_forbidden`                               | 422       | Global HMS scope cannot include `branchId` / `doctorId`                   |
| `branch_id_required`                                         | 422       | Hospital HMS scope needs `branchId`                                       |
| `hospital_scope_doctor_forbidden`                            | 422       | Hospital HMS scope cannot lock a `doctorId`                               |
| `doctor_scope_ids_required`                                  | 422       | Doctor HMS scope needs `branchId` and `doctorId`                          |
| `sync_not_allowed`                                           | 422       | `sync-doctors` is for hospital/doctor scopes only                         |
| `email_profile_missing`                                      | 422       | No verified Omni mailbox; add one or pass `emailProfileId`                |
| `email_template_missing`                                     | 422       | No email template; attach in Omni or pass `emailTemplateId`               |
| `email_profile_not_found` / `email_template_not_found`       | 422       | Body id does not match your Omni mailbox/template                         |
| `whatsapp_template_missing`                                  | 422       | No WhatsApp profile/template; attach in Omni or pass `whatsappTemplateId` |
| `whatsapp_profile_not_found` / `whatsapp_template_not_found` | 422       | Body id does not match your Omni WhatsApp profile/template                |
| `invalid_scheduled_at`                                       | 422       | Bad `scheduledAt` / `emailScheduledAt` / `whatsappScheduledAt`            |

## Try It tips

* Empty Authorization → blocked before Send
* Wrong key → `401`
* CORS on browser Try It → use cURL/Postman against production
