curl -sS -X POST "https://dashboard.ondial.ai/api/v1/inbound-agents" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/inbound-agents", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"POST",
"https://dashboard.ondial.ai/api/v1/inbound-agents",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
},
json={
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": True,
"bookingEnabled": True,
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/inbound-agents");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Main hospital line',
'category' => 'healthcare_reception',
'phoneNumber' => '+919876543210',
'appointmentScope' => 'hospital',
'branchId' => 'YOUR_BRANCH_ID',
'customApiBaseUrl' => 'https://YOUR_HMS_HOST/ondial',
'customApiSecret' => 'YOUR_SHARED_SECRET',
'slotsEnabled' => true,
'bookingEnabled' => true,
]),
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . " " . $response;import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://dashboard.ondial.ai/api/v1/inbound-agents"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://dashboard.ondial.ai/api/v1/inbound-agents");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Content = new StringContent("""
{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}`)
req, _ := http.NewRequest("POST", "https://dashboard.ondial.ai/api/v1/inbound-agents", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ONDIAL_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}{
"agent": {
"id": "<string>",
"_id": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"category": "<string>",
"status": "active",
"inboundScriptStatus": "none",
"greetingMessage": "<string>",
"primaryLanguage": "<string>",
"selectedVoice": {
"name": "Priya",
"displayName": "Ishita",
"gender": "Female",
"language": {
"code": "hi-IN",
"name": "Hindi"
},
"tier": "standard",
"accent": "Standard",
"playbackSpeed": 1,
"audioFile": "<string>"
},
"companyId": "<string>",
"selectedKnowledgebases": [
{
"fileId": "<string>",
"fileName": "<string>",
"title": "<string>",
"knowledgebaseId": "<string>",
"wordCount": 123
}
],
"appointmentScope": "global",
"branchId": "<string>",
"doctorId": "<string>",
"slotsEnabled": true,
"bookingEnabled": true,
"doctorsSyncEnabled": true,
"validateHookEnabled": true,
"doctorsLastSyncedAt": "2023-11-07T05:31:56Z",
"customApiBaseUrl": "<string>"
}
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"leadId": 177,
"error": "<string>",
"reasonCode": "<string>",
"missing": [
"<string>"
]
}Create inbound agent
Create an agent on a number you already own (starts inactive). Optionally link companyId and KB fileIds.
curl -sS -X POST "https://dashboard.ondial.ai/api/v1/inbound-agents" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/inbound-agents", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"POST",
"https://dashboard.ondial.ai/api/v1/inbound-agents",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
},
json={
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": True,
"bookingEnabled": True,
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/inbound-agents");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Main hospital line',
'category' => 'healthcare_reception',
'phoneNumber' => '+919876543210',
'appointmentScope' => 'hospital',
'branchId' => 'YOUR_BRANCH_ID',
'customApiBaseUrl' => 'https://YOUR_HMS_HOST/ondial',
'customApiSecret' => 'YOUR_SHARED_SECRET',
'slotsEnabled' => true,
'bookingEnabled' => true,
]),
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . " " . $response;import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://dashboard.ondial.ai/api/v1/inbound-agents"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://dashboard.ondial.ai/api/v1/inbound-agents");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Content = new StringContent("""
{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode + " " + await response.Content.ReadAsStringAsync());package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Main hospital line",
"category": "healthcare_reception",
"phoneNumber": "+919876543210",
"appointmentScope": "hospital",
"branchId": "YOUR_BRANCH_ID",
"customApiBaseUrl": "https://YOUR_HMS_HOST/ondial",
"customApiSecret": "YOUR_SHARED_SECRET",
"slotsEnabled": true,
"bookingEnabled": true
}`)
req, _ := http.NewRequest("POST", "https://dashboard.ondial.ai/api/v1/inbound-agents", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("ONDIAL_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}{
"agent": {
"id": "<string>",
"_id": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"category": "<string>",
"status": "active",
"inboundScriptStatus": "none",
"greetingMessage": "<string>",
"primaryLanguage": "<string>",
"selectedVoice": {
"name": "Priya",
"displayName": "Ishita",
"gender": "Female",
"language": {
"code": "hi-IN",
"name": "Hindi"
},
"tier": "standard",
"accent": "Standard",
"playbackSpeed": 1,
"audioFile": "<string>"
},
"companyId": "<string>",
"selectedKnowledgebases": [
{
"fileId": "<string>",
"fileName": "<string>",
"title": "<string>",
"knowledgebaseId": "<string>",
"wordCount": 123
}
],
"appointmentScope": "global",
"branchId": "<string>",
"doctorId": "<string>",
"slotsEnabled": true,
"bookingEnabled": true,
"doctorsSyncEnabled": true,
"validateHookEnabled": true,
"doctorsLastSyncedAt": "2023-11-07T05:31:56Z",
"customApiBaseUrl": "<string>"
}
}{
"error": "Invalid or inactive API key",
"reasonCode": "unauthorized"
}{
"leadId": 177,
"error": "<string>",
"reasonCode": "<string>",
"missing": [
"<string>"
]
}phoneNumber or phoneNumberId required. Healthcare HMS fields (appointmentScope, customApiBaseUrl, …) are optional. Then activate.
Company + knowledge base
Recommended HMS order:- List companies → pick
id - List knowledge documents → pick
fileIds - Create agent with
companyIdandselectedKnowledgebases: ["fileId", …]
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
Paste only your API key (ond_live_… or ond_test_…). Do not type the word Bearer - the playground adds it.
Body
"healthcare_reception"
Optional. Defaults from selectedVoice.language.code when selectedVoice is provided.
Copy from GET /api/v1/voices voices[].selectedVoice. Omit to auto-pick a default for the phone market.
Hide child attributes
Hide child attributes
Catalog voice id (case-insensitive match).
"Priya"
"Ishita"
"Female"
Normalized tier (catalog basic maps to standard).
standard, premium, elite "Standard"
0.5 <= x <= 21
Alternative to selectedVoice: copy voice from another tenant-owned inbound agent.
Optional. Must be owned by the API-key tenant (from GET /companies). If omitted, Ondial auto-picks the latest company.
Optional. Array of fileId strings (or { fileId }) from GET /knowledge-bases/documents. Ondial resolves titles/knowledgebaseId.
["1730000000-brochure.pdf"]
Healthcare HMS: one number = one scope.
global, hospital, doctor Required for hospital and doctor scopes. Use your HMS hospital/org ID.
Required for doctor scope. Use your HMS doctor ID.
"https://YOUR_HMS_HOST/ondial"
Optional shared secret; Ondial sends Authorization: Bearer …
Response
Created (typically inactive until activate)
Hide child attributes
Hide child attributes
active, inactive none, generating, ready, error BCP-47 code aligned with selectedVoice.language.code
Hide child attributes
Hide child attributes
Catalog voice id (case-insensitive match).
"Priya"
"Ishita"
"Female"
Normalized tier (catalog basic maps to standard).
standard, premium, elite "Standard"
0.5 <= x <= 21
Linked company profile id from GET /api/v1/companies
Linked KB docs (metadata only). Assign with fileId list from GET /api/v1/knowledge-bases/documents.
global, hospital, doctor 
