Agent
Configure Astra, the workspace's AI phone agent: voice, greeting, jobs, business hours, routing — then publish it live.
Every workspace has an AI agent (shown as Astra in the app) — and since 2026-10-29 it can have several: one per line, a Spanish line, a sales desk. An agent answers calls on the numbers routed to it and places outbound AI calls. Changes are saved as a draft and only reach live calls after you publish.
The singular /v1/api/agent endpoints below always address the workspace's primary agent — the first one created. The /v1/api/agents collection addresses each agent by id.
#The agent object
iduuidnamestring — What the agent calls itself on the phone.greetingstring | null — The first sentence on every answered call.tonestring | null — Free-text style guidance, for examplewarm and concise.voicestring | null —astra(default),luna,andromeda,celeste,albion,atrium,bondororion.languagestring | null — For exampleen-US.instructionsstring | null — Compiled instructions (read-only, built from the config and your knowledge).status"draft" | "published"enabledboolean — Master switch. Whenfalse, routed calls fall back to the team and the agent answers no texts either.textingEnabledboolean — Business AI Texting: the agent may answer inbound texts on the lines linked to it. Toggle withPOST /agents/:id/texting— it needs no publish.recordCallsboolean — AI call recording. Whentrue, the audio of every call this agent handles — inbound calls it answers and outbound calls it places — is kept and attached to the call in the conversation thread, next to the transcript and summary. Toggle withPOST /agents/:id/recording; needs no publish.recordingConsentobject | null — who acknowledged the recording-consent note and when:{ acknowledgedAt, acknowledgedBy, acknowledgedByName }. Written once, the first time recording is turned on for this agent (see the endpoint below); never cleared by later on/off changes.nulluntil then.timezonestring — IANA timezone used for business hours.businessHoursobject —{ mode: "always" }or{ mode: "scheduled", weekly: { mon: [{ start: "09:00", end: "17:00" }], … } }. Days aresun–sat; times are 24-hour andendis exclusive.inHoursAction/offHoursActionstring — Who answers during and outside business hours:agent,voicemail,app(ring the team) orforward.jobsarray of {name, instructions} — The tasks the agent handles (for example "Book appointments", "Answer pricing questions").
#Retrieve the agent
/v1/api/agentReturns the agent (null until one is created) and this cycle's AI credit usage.
Scope: agent:manage
Returns { agent, credits: { cycleId, used, included, remaining } | null }.
curl https://api.ody.co/v1/api/agent \
-H "Authorization: Bearer $ODY_API_KEY"const { agent, credits } = await ody.agent.get();res = client.agent.get(){
"agent": {
"id": "0d9c…",
"name": "Astra",
"greeting": "Thanks for calling Acme Plumbing, this is Astra. How can I help?",
"voice": "astra",
"status": "published",
"enabled": true,
"timezone": "America/Chicago",
"businessHours": { "mode": "scheduled", "weekly": { "mon": [{ "start": "08:00", "end": "18:00" }] } },
"inHoursAction": "agent",
"offHoursAction": "agent",
"jobs": [{ "name": "Book appointments", "instructions": "Offer the next two open slots." }]
},
"credits": { "cycleId": "2026-10", "used": 1200, "included": 3000, "remaining": 1800 }
}#Update the agent
/v1/api/agentCreates the agent if there isn't one yet, otherwise updates the draft. Only the fields you send change. jobs is replaced wholesale. Send at least one field.
Changes don't reach live calls until you publish.
Scope: agent:manage
Body: any of name, greeting, tone, voice, language, timezone, businessHours, inHoursAction, offHoursAction, enabled, jobs. See the agent object above.
Returns { agent }.
curl -X PATCH https://api.ody.co/v1/api/agent \
-H "Authorization: Bearer $ODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"greeting": "Thanks for calling Acme Plumbing, this is Astra. How can I help?",
"voice": "luna",
"timezone": "America/Chicago",
"offHoursAction": "agent",
"jobs": [
{ "name": "Book appointments", "instructions": "Offer the next two open slots." },
{ "name": "Emergencies", "instructions": "For burst pipes, take the address and say a plumber will call back within 15 minutes." }
]
}'await ody.agent.update({
greeting: "Thanks for calling Acme Plumbing, this is Astra. How can I help?",
voice: "luna",
timezone: "America/Chicago",
offHoursAction: "agent",
jobs: [{ name: "Book appointments", instructions: "Offer the next two open slots." }],
});client.agent.update(
greeting="Thanks for calling Acme Plumbing, this is Astra. How can I help?",
voice="luna",
timezone="America/Chicago",
off_hours_action="agent",
jobs=[{"name": "Book appointments", "instructions": "Offer the next two open slots."}],
)#Publish the agent
/v1/api/agent/publishPushes the saved configuration live to the telephony layer. New calls use it within seconds. With a test key, publishing is simulated.
Scope: agent:manage
Returns { agent, simulated? }. Returns 409 when the configuration is incomplete; the message says what's missing.
curl -X POST https://api.ody.co/v1/api/agent/publish \
-H "Authorization: Bearer $ODY_API_KEY"await ody.agent.publish();client.agent.publish()What the agent knows (your services, prices, FAQs) comes from the workspace's knowledge base — the articles and folders in the app's Knowledge tab whose audience includes this agent. Read, write and search them with the Knowledge API (knowledge:read / knowledge:write). Changes there are pushed to the published agent automatically; you don't need to call POST /agent/publish.
#Several agents
A workspace can run several AI agents. Each has its own name, greeting, voice, hours and lines; all of them share the workspace's knowledge base and AI credits. The number of agents is set by the plan (Starter 1, Growth 3, Enterprise 10; trials 3) — GET /agents returns the limit.
#The agent summary
GET /agents returns the agent object plus:
primaryboolean —truefor the first agent — the one the singular/agentendpoints, the mobile apps and the MCP tools withoutagentIdmean.reachobject — How callers get to this agent:numbers(lines whose inbound calls go straight to it),menuNumbers([{ e164, digit }]— phone-menu keys that lead to it, nested keys concatenated such as"31"),flowNumbers(lines whose call flow hands over to it), andtextingNumbers(lines whose inbound texts it answers — Business AI Texting, a separate link from the voice ones). An agent with an empty reach is published but unreachable.
#List agents
/v1/api/agentsEvery agent, oldest (primary) first, with its reach.
Scope: agent:manage
Returns { agents, limit }.
curl https://api.ody.co/v1/api/agents \
-H "Authorization: Bearer $ODY_API_KEY"const { agents, limit } = await ody.agents.list();res = client.agents.list()
agents, limit = res["agents"], res["limit"]#Create an agent
/v1/api/agentsAdds another agent as a draft. It starts with every knowledge article whose audience is every AI. Give it a line with attach (or connect a number with agentId), then publish it.
Scope: agent:manage
namestring required — ≤ 60 characters. Callers hear it in phone menus ("Press 2 for Sales").greeting,tone,voice,languagestring — As on update.
Returns 201 { agent }. Returns 429 resource_exhausted when the plan's limit is reached (details.reason = "limit_reached", details.limit).
curl -X POST https://api.ody.co/v1/api/agents \
-H "Authorization: Bearer $ODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Sales","voice":"luna","greeting":"Thanks for calling sales!"}'const sales = await ody.agents.create({ name: "Sales", voice: "luna" });sales = client.agents.create(name="Sales", voice="luna")const agent = await ody.agents.get(sales.id);#Update one agent
/v1/api/agents/:idSame body and semantics as Update the agent, for the agent with this id. Saves a draft.
Scope: agent:manage · Returns { agent }.
await ody.agents.update(sales.id, { tone: "upbeat", jobs: [{ name: "Quote", instructions: "Collect the job size and promise a call back." }] });client.agents.update(sales["id"], tone="upbeat")#Publish one agent
/v1/api/agents/:id/publishPushes this agent's saved configuration live. With a test key, publishing is simulated.
Scope: agent:manage · Returns { agent, simulated? }; 409 failed_precondition when the configuration is incomplete.
await ody.agents.publish(sales.id);#Attach an agent to a line
/v1/api/agents/:id/attachMakes the agent reachable on one of the workspace's numbers.
e164string required — One of the workspace's numbers.mode"number" | "menu" required —number: the line's inbound calls go to this agent (the same change as connecting a number).menu: the failover for a workspace with one line — the line becomes a phone menu, or its existing menu gets one more key. Whatever answered before keeps key 1 (the previous agent, voicemail, forwarding or the team); the new agent takes the next free key and the greeting announces it ("… Press 2 for Sales."). Needs phone menus (Growth and Enterprise).digitstring — Preferred key formenu(never1on a fresh menu). Default: the next free key.
Scope: agent:manage
Returns { mode, e164, digit?, menuCreated? } — menuCreated is true when the line had no menu before. Errors: permission_denied (plan has no phone menus), failed_precondition (the line runs a call flow — add an Astra step in the flow builder instead; the agent already answers this line; the menu already uses every key).
curl -X POST https://api.ody.co/v1/api/agents/$AGENT_ID/attach \
-H "Authorization: Bearer $ODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"e164":"+15125551234","mode":"menu"}'// One line, two agents: callers press 1 for Astra, 2 for Sales.
const r = await ody.agents.attach(sales.id, "+15125551234", "menu");
console.log(r.digit, r.menuCreated); // "2" truer = client.agents.attach(sales["id"], "+15125551234", "menu")#Record the agent's calls
/v1/api/agents/:id/recordingTurns AI call recording on or off for one agent. When on, every call the agent handles is recorded dual-channel (the caller on one track, the agent on the other) and the audio lands on the call in the thread — the same row that already carries the transcript, the AI summary and any texts the agent sent. Playable in the Ody app (web, iOS, Android) and returned as the call's media on the activity. Independent of the per-number recording setting in the app, which only covers calls a person answers.
The switch is per agent: a phone-menu key or call-flow step that hands a call to a different agent records according to that agent's switch.
enabledboolean requiredacknowledgeConsentboolean — required withenabled: truethe first time for an agent (see below). Ignored afterwards.
Scope: agent:manage
Returns { agent } — read the switch back as agent.recordCalls. No publish is needed; the change applies from the next call. Enabling requires the Growth-plan call-recording feature — 403 permission_denied otherwise; disabling always works.
Recording laws vary by jurisdiction: some places require every party on a call to be told it is recorded ("two-party consent"). Ody does not play a recording announcement automatically — add one line to the agent's greeting (for example "Just so you know, calls may be recorded.").
Because of that, the first enable for an agent must carry acknowledgeConsent: true — your acknowledgement of the above. Without it the call returns 409 failed_precondition with reason: "consent_required". The acknowledgement is stored once as agent.recordingConsent (who, when), shown next to the switch in the Ody apps, and never asked again for that agent — turning recording off and on later needs no flag.
curl -X POST https://api.ody.co/v1/api/agents/$AGENT_ID/recording \
-H "Authorization: Bearer $ODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"acknowledgeConsent":true}'const { agent } = await ody.agents.setRecording(sales.id, true, { acknowledgeConsent: true });
console.log(agent.recordCalls); // true
console.log(agent.recordingConsent?.acknowledgedAt); // "2026-11-04T17:21:08.512Z"r = client.agents.set_recording(sales["id"], True, acknowledge_consent=True)
print(r["agent"]["recordCalls"]) # True
print(r["agent"]["recordingConsent"]["acknowledgedAt"]){ "error": { "code": "failed_precondition", "reason": "consent_required",
"message": "Some places require every person on a call to be told it is being recorded. Acknowledge the consent note (acknowledgeConsent: true) to turn recording on." } }#Delete an agent
/v1/api/agents/:idIrreversible. Lines this agent answered go back to ringing the team; phone-menu keys that led to it are removed (a menu left with no keys is turned off). Knowledge articles are untouched. A workspace keeps at least one agent — deleting the last one returns 409 failed_precondition; set enabled: false instead. With a test key the delete is simulated.
Scope: agent:manage · Returns { ok: true, detachedNumbers, menusUpdated, simulated? }.
await ody.agents.delete(sales.id);client.agents.delete(sales["id"])POST /v1/api/calls accepts an optional agentId; without it the primary agent calls. The same is true for the MCP tool place_call.
An agent can also answer the texts your numbers receive — from the same knowledge base, in your team's voice, with hand-off built in. The switches live on their own page: Business AI Texting (GET/POST /agents/:id/texting, PUT /numbers/:e164/texting, POST /conversations/:id/ai-texting).