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

# Create inbound agent

> API agents on numbers you already own.

<Steps>
  <Step title="Own a number">[Get credits](/api-reference/endpoint/inbound-agents/get-credits) → [list available](/api-reference/endpoint/inbound-agents/list-available-numbers) → [purchase](/api-reference/endpoint/inbound-agents/purchase-numbers), or buy in the dashboard. Then [list owned numbers](/api-reference/endpoint/inbound-agents/list-owned-numbers).</Step>
  <Step title="Create">`POST /api/v1/inbound-agents` — starts **inactive**. Healthcare HMS: pass `appointmentScope` + Custom API URL (sets appointments + `hcBookingPath` automatically). Optional `copyVoiceFromAgentId`. [Healthcare HMS integration](/get-started/guides/healthcare-hms-integration).</Step>
  <Step title="Dashboard (optional)">Wire Sheets / Zoho / Custom API and finish script if you are not using the HMS APIs above. For HMS, pick Integration type **HMS Custom API** and use real hospital/doctor IDs from your system.</Step>
  <Step title="Sync doctors (HMS hospital/doctor)">`POST .../sync-doctors`.</Step>
  <Step title="Generate script">`POST .../generate-script` — poll until `inboundScriptStatus: ready`.</Step>
  <Step title="Activate">`POST .../activate` `{ "activate": true }`.</Step>
  <Step title="Lookup (optional)">`POST .../crm/lookup` with `useCase` + phone/order fields.</Step>
</Steps>

Activate: `phone_not_owned`, `script_not_ready`. HMS scope: `global_scope_locks_forbidden`, `branch_id_required`, `doctor_scope_ids_required`.
