Skip to main content
POST
Create inbound agent on owned number
phoneNumber or phoneNumberId required. Healthcare HMS fields (appointmentScope, customApiBaseUrl, …) are optional. Then activate.

Company + knowledge base

Recommended HMS order:
  1. List companies → pick id
  2. List knowledge documents → pick fileIds
  3. Create agent with companyId and selectedKnowledgebases: ["fileId", …]
If companyId is omitted, Ondial auto-picks the tenant’s latest company. Unknown or other-tenant ids → 422 (company_not_found / knowledge_document_not_found). Full HMS walkthrough: Healthcare HMS integration.

Authorizations

Authorization
string
header
required

Paste only your API key (ond_live_… or ond_test_…). Do not type the word Bearer — the playground adds it.

Body

application/json
name
string
category
string
Example:

"healthcare_reception"

phoneNumber
string
phoneNumberId
string
greetingMessage
string
companyId
string

Optional. Must be owned by the API-key tenant (from GET /companies). If omitted, Ondial auto-picks the latest company.

selectedKnowledgebases
(string | object)[]

Optional. Array of fileId strings (or { fileId }) from GET /knowledge-bases/documents. Ondial resolves titles/knowledgebaseId.

Example:
appointmentScope
enum<string>

Healthcare HMS: one number = one scope.

Available options:
global,
hospital,
doctor
branchId
string

Required for hospital and doctor scopes. Use your HMS hospital/org ID.

doctorId
string

Required for doctor scope. Use your HMS doctor ID.

customApiBaseUrl
string
Example:

"https://YOUR_HMS_HOST/ondial"

customApiSecret
string

Optional shared secret; Ondial sends Authorization: Bearer …

customApiTimeoutMs
integer
slotsEnabled
boolean
bookingEnabled
boolean
doctorsSyncEnabled
boolean
validateHookEnabled
boolean

Response

Created (typically inactive until activate)

agent
object