OdyDocs

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

  • id uuid
  • name string — What the agent calls itself on the phone.
  • greeting string | null — The first sentence on every answered call.
  • tone string | null — Free-text style guidance, for example warm and concise.
  • voice string | null — astra (default), luna, andromeda, celeste, albion, atrium, bond or orion.
  • language string | null — For example en-US.
  • instructions string | null — Compiled instructions (read-only, built from the config and your knowledge).
  • status "draft" | "published"
  • enabled boolean — Master switch. When false, routed calls fall back to the team and the agent answers no texts either.
  • textingEnabled boolean — Business AI Texting: the agent may answer inbound texts on the lines linked to it. Toggle with POST /agents/:id/texting — it needs no publish.
  • recordCalls boolean — AI call recording. When true, 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 with POST /agents/:id/recording; needs no publish.
  • recordingConsent object | 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. null until then.
  • timezone string — IANA timezone used for business hours.
  • businessHours object — { mode: "always" } or { mode: "scheduled", weekly: { mon: [{ start: "09:00", end: "17:00" }], … } }. Days are sun–sat; times are 24-hour and end is exclusive.
  • inHoursAction / offHoursAction string — Who answers during and outside business hours: agent, voicemail, app (ring the team) or forward.
  • jobs array of {name, instructions} — The tasks the agent handles (for example "Book appointments", "Answer pricing questions").

#Retrieve the agent

GET/v1/api/agent

Returns 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"
Response
{
  "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

PATCH/v1/api/agent

Creates 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." }
    ]
  }'

#Publish the agent

POST/v1/api/agent/publish

Pushes 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"
Where the agent's knowledge comes from

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:

  • primary boolean — true for the first agent — the one the singular /agent endpoints, the mobile apps and the MCP tools without agentId mean.
  • reach object — 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), and textingNumbers (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

GET/v1/api/agents

Every 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"

#Create an agent

POST/v1/api/agents

Adds 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

  • name string required — ≤ 60 characters. Callers hear it in phone menus ("Press 2 for Sales").
  • greeting, tone, voice, language string — 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!"}'

#Retrieve one agent

GET/v1/api/agents/:id

Scope: agent:manage · Returns { agent } or 404 not_found.

TypeScript
const agent = await ody.agents.get(sales.id);

#Update one agent

PATCH/v1/api/agents/:id

Same 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." }] });

#Publish one agent

POST/v1/api/agents/:id/publish

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

TypeScript
await ody.agents.publish(sales.id);

#Attach an agent to a line

POST/v1/api/agents/:id/attach

Makes the agent reachable on one of the workspace's numbers.

  • e164 string 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).
  • digit string — Preferred key for menu (never 1 on 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"}'

#Record the agent's calls

POST/v1/api/agents/:id/recording

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

  • enabled boolean required
  • acknowledgeConsent boolean — required with enabled: true the 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.

Consent is yours to handle — and acknowledged once

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}'
409 — first enable without the acknowledgement
{ "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

DELETE/v1/api/agents/:id

Irreversible. 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);
Which agent places an outbound call?

POST /v1/api/calls accepts an optional agentId; without it the primary agent calls. The same is true for the MCP tool place_call.

Texts, too

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

Last updated Wed Nov 04 2026 00:00:00 GMT+0000 (Coordinated Universal Time)Something wrong on this page? Tell us