curl -sS -X PATCH "https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID", {
method: "PATCH",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"PATCH",
"https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
},
json={
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1,
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'string',
'greetingMessage' => 'string',
'category' => 'string',
'maxCallDuration' => 1,
]),
]);
$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/YOUR_ID"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("""
{
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}
"""))
.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(new HttpMethod("PATCH"), "https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Content = new StringContent("""
{
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}
""", 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": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}`)
req, _ := http.NewRequest("PATCH", "https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID", 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"
}{
"error": "Not found",
"reasonCode": "not_found"
}Update inbound agent
Patch name, greeting, category, healthcare HMS fields, companyId, or selectedKnowledgebases.
curl -sS -X PATCH "https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID" \
-H "Authorization: Bearer $ONDIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}'const res = await fetch("https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID", {
method: "PATCH",
headers: {
"Authorization": `Bearer ${process.env.ONDIAL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}),
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.request(
"PATCH",
"https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID",
headers={
"Authorization": f"Bearer {os.environ['ONDIAL_API_KEY']}",
},
json={
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1,
},
timeout=30,
)
print(res.status_code, res.json())<?php
$ch = curl_init("https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ONDIAL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'string',
'greetingMessage' => 'string',
'category' => 'string',
'maxCallDuration' => 1,
]),
]);
$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/YOUR_ID"))
.header("Authorization", "Bearer " + System.getenv("ONDIAL_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("""
{
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}
"""))
.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(new HttpMethod("PATCH"), "https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID");
request.Headers.Add("Authorization", "Bearer " + Environment.GetEnvironmentVariable("ONDIAL_API_KEY"));
request.Content = new StringContent("""
{
"name": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}
""", 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": "string",
"greetingMessage": "string",
"category": "string",
"maxCallDuration": 1
}`)
req, _ := http.NewRequest("PATCH", "https://dashboard.ondial.ai/api/v1/inbound-agents/YOUR_ID", 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"
}{
"error": "Not found",
"reasonCode": "not_found"
}Company + knowledge base
companyId- set to link;nullclears; omit leaves unchangedselectedKnowledgebases- replace with fileId list from list documents;[]clears; omit leaves unchanged
Authorizations
Paste only your API key (ond_live_… or ond_test_…). Do not type the word Bearer - the playground adds it.
Path Parameters
Body
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
Set to link a company; null clears. Omit to leave unchanged (auto-pick only if agent still has no company).
Replace linked KB docs by fileId list. Empty array clears. Omit to leave unchanged.
global, hospital, doctor Response
Updated
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 
