> ## 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.

# API overview

> What /api/v1 can and cannot do.

## Shipped surface

| Area              | Endpoints                                                                                                                                                                                                                    |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Core              | `GET /ping`, `GET /omni/templates`, `POST /leads`                                                                                                                                                                            |
| Outbound          | `GET /campaigns`, `GET /campaigns/{id}`, `GET /campaigns/{id}/contacts` (read-only; create/start in dashboard)                                                                                                               |
| Contacts          | `GET/DELETE /contacts/{id}`, `GET .../calls`, `GET .../calls/{callId}`, `POST .../cancel`, `POST .../followups`                                                                                                              |
| Events            | `POST /events`, `GET/POST/DELETE /event-routes`                                                                                                                                                                              |
| Inbound           | `GET/POST /inbound-agents`, `GET/PATCH .../{id}`, `POST .../activate`, `POST .../sync-doctors`, `POST .../generate-script`, `POST .../crm/lookup` — create/PATCH accept `companyId` + `selectedKnowledgebases` (fileId list) |
| Numbers / credits | `GET /credits`, `GET /numbers`, `GET /numbers/available`, `POST /numbers/purchase` (pool; debit credits)                                                                                                                     |
| Companies         | `GET/POST /companies`, `GET/PATCH/DELETE /companies/{id}` — scopes `companies:read` / `companies:write`                                                                                                                      |
| Knowledge bases   | `GET/POST /knowledge-bases/documents`, `GET/DELETE .../{fileId}`, `GET .../upload-billing-info` — scopes `knowledge:read` / `knowledge:write`                                                                                |

## Scoped access (company + KB)

Default API keys include lead/inbound scopes only. Super Admin must grant **`companies:*`** and **`knowledge:*`** when approving your key.

Missing scope → `403` with `reasonCode: "forbidden"` and a `missing` array.

Company and KB responses **never** include SMTP passwords, WhatsApp tokens, or file download URLs.

## Explicitly not in public API

| Capability                                 | Where it lives                                                   |
| ------------------------------------------ | ---------------------------------------------------------------- |
| Create / update / delete / start campaigns | **Dashboard wizard**                                             |
| Twilio / Telnyx number purchase            | Dashboard                                                        |
| Credit top-up / concurrency packages       | Dashboard                                                        |
| KB file download / binary stream           | Dashboard session (not v1)                                       |
| CRM OAuth (Zoho, HubSpot, …)               | Dashboard Integrations                                           |
| Custom API URL on inbound healthcare HMS   | **Public API** create/update inbound agent (or inbound setup UI) |
| Tenant webhooks / DNC lists                | Dashboard **Settings** (session)                                 |

## Custom CRM pattern

1. UI: empty API campaign → start
2. API: `POST /leads` (or `POST /events` with a mapped `eventType`)
3. WhatsApp/email: `GET /omni/templates` then pass ids + `templateVariables` / `whatsappParams` — [guide](/get-started/guides/send-whatsapp-and-email)
4. Optional: Settings webhooks for status callbacks
5. Inbound: wire Sheets/Zoho/Custom API in UI → `POST .../crm/lookup` when you need a read without a live call. Healthcare HMS platforms: [Healthcare HMS integration](/get-started/guides/healthcare-hms-integration).

## Versioning

`/api/v1` remains supported ≥ 12 months after any future `/api/v2` GA; breaking changes get ≥ 90 days notice.
