client.voice.get() -> unknown
-
-
-
Get the current account-level default voice for AI phone agents.
Returns which voice is used for all AI agents under this account unless overridden at the agent level or per-call. Controls how your AI agents sound during phone conversations.
-
-
-
await client.voice.get();
-
-
-
requestOptions:
VoiceClient.RequestOptions
-
-
client.voice.reset() -> unknown
-
-
-
Reset account voice to the system default.
Removes the account-level voice override so all AI agents fall back to the system default voice during phone calls (unless they have their own voice_id configured).
-
-
-
await client.voice.reset();
-
-
-
requestOptions:
VoiceClient.RequestOptions
-
-
client.voice.set({ ...params }) -> unknown
-
-
-
Set the account-level default voice for AI phone agents.
This becomes the default voice for ALL AI agents under this account, controlling how they sound on phone calls. Individual agents or specific calls can still override this setting.
Voice resolution priority:
- Per-call voice_id (POST /v1/calls)
- Agent voice_id (PATCH /v1/agents/{id})
- Account default (this endpoint) ← you are here
- System default (Supportive Male)
Accepts:
- A preset name: "female-1", "female-2", "female-3", "male-1", "male-2", "male-3"
- A Cartesia voice UUID: "f786b574-daa5-4673-aa0c-cbe3e8534c02"
-
-
-
await client.voice.set({ voice_id: "voice_id" });
-
-
-
request:
AgentlineApi.VoiceSettingUpdate
-
requestOptions:
VoiceClient.RequestOptions
-
-
client.voice.list() -> unknown
-
-
-
List all available voice presets for AI phone agents.
Returns named TTS (text-to-speech) voice presets that can be used when configuring AI agents or making phone calls. Each voice defines how your AI agent sounds on the phone.
You can use a preset name (e.g. "female-1", "male-1") or pass any valid Cartesia voice UUID directly as a voice_id.
-
-
-
await client.voice.list();
-
-
-
requestOptions:
VoiceClient.RequestOptions
-
-
client.agents.list() -> unknown
-
-
-
List all AI voice agents configured on your account.
Returns every AI phone agent you've created, including their system prompts, voice settings, and associated phone numbers. Useful for checking which agents are ready to make or receive calls.
-
-
-
await client.agents.list();
-
-
-
requestOptions:
AgentsClient.RequestOptions
-
-
client.agents.create({ ...params }) -> AgentlineApi.AgentOut
-
-
-
Create a new AI voice agent for telephony.
Sets up a new AI phone agent with a custom system prompt, voice, and greeting. Once created, buy a phone number and attach it to this agent so it can make and receive calls autonomously.
Fields:
- name: Display name for the agent
- system_prompt: Instructions that define the agent's personality and behavior on calls
- initial_greeting: What the AI agent says when the call connects
- voice_id: TTS voice preset (e.g. "female-1") or Cartesia UUID
- transfer_number: Phone number to transfer calls to (e.g. a human operator)
- voicemail_message: Message the agent leaves if the call goes to voicemail
-
-
-
await client.agents.create({ name: "name" });
-
-
-
request:
AgentlineApi.AgentCreate
-
requestOptions:
AgentsClient.RequestOptions
-
-
client.agents.get({ ...params }) -> unknown
-
-
-
Get details of a specific AI voice agent.
Returns the agent's full configuration including system prompt, voice settings, greeting, and transfer number.
-
-
-
await client.agents.get({ agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.GetAgentsRequest
-
requestOptions:
AgentsClient.RequestOptions
-
-
client.agents.delete({ ...params }) -> unknown
-
-
-
Delete an AI voice agent.
Permanently removes the agent, its calls, messages, and conversations, and detaches any phone numbers assigned to it. Detached numbers remain active on your account and can be reassigned to another agent.
-
-
-
await client.agents.delete({ agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.DeleteAgentsRequest
-
requestOptions:
AgentsClient.RequestOptions
-
-
client.agents.update({ ...params }) -> unknown
-
-
-
Update an AI voice agent's configuration.
Modify any combination of the agent's settings: system prompt, voice, greeting, transfer number, or voicemail message. Changes take effect on the next call the agent handles. Only include the fields you want to change — unset fields are preserved.
-
-
-
await client.agents.update({ agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.AgentUpdate
-
requestOptions:
AgentsClient.RequestOptions
-
-
client.billing.getBalance() -> unknown
-
-
-
Get your AI telephony account balance and rate card.
Returns the current balance, currency, billing rates for calls and phone numbers, and how many call minutes or phone numbers the balance can cover. Use this to check affordability before making calls or buying numbers for your AI agents.
-
-
-
await client.billing.getBalance();
-
-
-
requestOptions:
BillingClient.RequestOptions
-
-
client.billing.getExpenditure({ ...params }) -> unknown
-
-
-
Get a detailed expenditure breakdown for AI telephony usage.
Shows total spend split by category (voice calls, phone number provisioning, top-ups, refunds) with counts and averages. Useful for tracking how much your AI agents are spending on phone calls and phone numbers.
-
-
-
await client.billing.getExpenditure();
-
-
-
request:
AgentlineApi.GetExpenditureBillingRequest
-
requestOptions:
BillingClient.RequestOptions
-
-
client.billing.listCallCharges({ ...params }) -> unknown
-
-
-
List individual call charges from AI agent phone calls.
Each entry includes the voice call duration, cost, direction (inbound/outbound), phone numbers involved, and timestamp. Shows exactly how much each AI agent call cost.
-
-
-
await client.billing.listCallCharges();
-
-
-
request:
AgentlineApi.ListCallChargesBillingRequest
-
requestOptions:
BillingClient.RequestOptions
-
-
client.billing.listNumberCharges({ ...params }) -> unknown
-
-
-
List phone number provisioning charges.
Shows the cost of each phone number bought for your AI agents, including the number, country, and current status.
-
-
-
await client.billing.listNumberCharges();
-
-
-
request:
AgentlineApi.ListNumberChargesBillingRequest
-
requestOptions:
BillingClient.RequestOptions
-
-
client.billing.getSummary({ ...params }) -> unknown
-
-
-
Month-over-month spending summary.
Returns total debits grouped by month for trend analysis.
-
-
-
await client.billing.getSummary();
-
-
-
request:
AgentlineApi.GetSummaryBillingRequest
-
requestOptions:
BillingClient.RequestOptions
-
-
client.calls.list({ ...params }) -> unknown
-
-
-
List voice calls made by your AI agents.
Returns call history with optional filters by agent or status. Each entry includes direction (inbound/outbound), duration, phone numbers, and current status.
Filters:
- agent_id: only calls for a specific AI agent
- status: "initiated", "in-progress", "completed", or "failed"
-
-
-
await client.calls.list();
-
-
-
request:
AgentlineApi.ListCallsRequest
-
requestOptions:
CallsClient.RequestOptions
-
-
client.calls.create({ ...params }) -> unknown
-
-
-
Make an outbound phone call from your AI agent.
Initiates a real phone call from the AI agent's phone number to the specified destination. The agent uses its configured system prompt, voice, and greeting to conduct the conversation autonomously.
The AI agent handles the entire call — speech-to-text, LLM reasoning, and text-to-speech — in real time. The call transcript is saved automatically and can be retrieved via GET /v1/calls/{call_id}/transcript.
Request body:
- agent_id: the AI agent making the call
- to_number: destination phone number in E.164 format (e.g. "+12125551234")
- from_number_id: (optional) specific number to call from
- system_prompt: (optional) override the agent's default prompt for this call
- initial_greeting: (optional) override the agent's greeting for this call
- voice_id: (optional) override the voice for this call
-
-
-
await client.calls.create({ agent_id: "agent_id", to_number: "to_number" });
-
-
-
request:
AgentlineApi.CallRequest
-
requestOptions:
CallsClient.RequestOptions
-
-
client.calls.get({ ...params }) -> unknown
-
-
-
Get full details of a specific voice call.
Returns the call's metadata including direction, phone numbers, status, duration, AI agent configuration used, and the full conversation transcript between the AI agent and the caller.
-
-
-
await client.calls.get({ call_id: "call_id" });
-
-
-
request:
AgentlineApi.GetCallsRequest
-
requestOptions:
CallsClient.RequestOptions
-
-
client.calls.pushContext({ ...params }) -> unknown
-
-
-
Push context into a LIVE relay-mode call (mid-call context injection).
This is the required way for backend agents (Hermes, OpenClaw, etc.) to answer a live caller after a
call.utteranceevent. Do your work, then POST a concise caller-ready response here. It is spoken verbatim and stored as the assistant turn for later conversation context.AUTHENTICATION (one of):
- Push token (preferred — no API key): the
push_tokenfrom thecall.utterancepayload, viaX-Push-Tokenheader,?token=query param, orpush_tokenbody field. - Bearer API key:
Authorization: Bearer al_live_...for the account that owns the call.
Body — any of these keys works (
contextis canonical): {"context": "the exact short response the caller should hear"}Other accepted keys:
summary,answer,response,reply,text,result.Every response must include the exact
turn_idfromcall.utterance. Late context is rejected instead of being applied to another question.Returns: delivered=true, status="live" — voice agent will speak it now delivered=true, status="duplicate" — identical retry already accepted HTTP 409 — turn is stale/cancelled HTTP 410 — call has ended. STOP working on this request and abandon any in-flight lookup. No further context will be spoken.
- Push token (preferred — no API key): the
-
-
-
await client.calls.pushContext({ call_id: "call_id", body: { "key": "value" } });
-
-
-
request:
AgentlineApi.PushContextCallsRequest
-
requestOptions:
CallsClient.RequestOptions
-
-
client.calls.hangup({ ...params }) -> unknown
-
-
-
Hang up an active phone call.
Programmatically terminates an in-progress voice call. Use this when the AI agent needs to end the conversation, or to force-stop a call that is no longer needed. The call's final transcript and billing are processed automatically after hangup.
-
-
-
await client.calls.hangup({ call_id: "call_id" });
-
-
-
request:
AgentlineApi.HangupCallsRequest
-
requestOptions:
CallsClient.RequestOptions
-
-
client.calls.getTranscript({ ...params }) -> unknown
-
-
-
Get the full conversation transcript for a call.
Returns the complete speech-to-text transcript of the phone call, with each turn labeled by role ("human" for the caller, "assistant" for the AI agent). Useful for reviewing what was said on the call, extracting information, or auditing AI agent behavior.
-
-
-
await client.calls.getTranscript({ call_id: "call_id" });
-
-
-
request:
AgentlineApi.GetTranscriptCallsRequest
-
requestOptions:
CallsClient.RequestOptions
-
-
client.events.poll({ ...params }) -> unknown
-
-
-
Poll for telephony events from your AI agents.
Returns pending events such as call completions, transcripts, and failures. Events are consumed on retrieval (one-time read) — once polled, they are automatically deleted from the mailbox.
Your AI agent should call this endpoint periodically to receive notifications about completed calls and their transcripts.
Filters:
- agent_id: only events for a specific AI agent
- event_type: e.g. "call.completed", "call.failed"
-
-
-
await client.events.poll();
-
-
-
request:
AgentlineApi.PollEventsRequest
-
requestOptions:
EventsClient.RequestOptions
-
-
client.events.peek({ ...params }) -> unknown
-
-
-
Peek at pending telephony events without consuming them.
Returns a preview of queued events (call completions, transcripts) without removing them from the mailbox. Useful for checking if there are events to process before committing to retrieve them.
-
-
-
await client.events.peek();
-
-
-
request:
AgentlineApi.PeekEventsRequest
-
requestOptions:
EventsClient.RequestOptions
-
-
client.messages.list({ ...params }) -> unknown
-
-
-
List SMS messages sent and received by your AI agents.
Returns message history with optional filters by AI agent or conversation. Each entry includes direction (inbound/outbound), phone numbers, message body, and delivery status.
-
-
-
await client.messages.list();
-
-
-
request:
AgentlineApi.ListMessagesRequest
-
requestOptions:
MessagesClient.RequestOptions
-
-
client.messages.send({ ...params }) -> unknown
-
-
-
Send an outbound SMS message from an AI agent's phone number.
-
-
-
await client.messages.send({ agent_id: "agent_id", to_number: "to_number", body: "body" });
-
-
-
request:
AgentlineApi.MessageSend
-
requestOptions:
MessagesClient.RequestOptions
-
-
client.messages.listConversations({ ...params }) -> unknown
-
-
-
List all SMS conversations for your AI agents.
Returns conversation threads, optionally filtered by AI agent. Each conversation represents an ongoing SMS exchange between an AI agent's phone number and an external contact.
-
-
-
await client.messages.listConversations();
-
-
-
request:
AgentlineApi.ListConversationsMessagesRequest
-
requestOptions:
MessagesClient.RequestOptions
-
-
client.numbers.list() -> unknown
-
-
-
List all phone numbers provisioned on your account.
Returns every phone number you've bought for your AI agents, including which agent each number is assigned to, the number's status (active/released), and country.
-
-
-
await client.numbers.list();
-
-
-
requestOptions:
NumbersClient.RequestOptions
-
-
client.numbers.buy({ ...params }) -> unknown
-
-
-
Buy a US phone number for your AI agent.
Searches for and purchases a real US phone number from the telephony provider, then attaches it to the specified AI agent. Once attached, the agent can make outbound calls and receive inbound calls on this number.
Each AI agent can only have ONE active phone number. Costs $2.00 per number.
Request body:
- agent_id: str (required) — the AI agent to assign this number to
- country: str (must be "US")
- number_type: "local" | "tollfree"
- area_code: preferred 3-digit US area code (e.g. "212" for NYC, "415" for SF)
-
-
-
await client.numbers.buy({ agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.NumberProvision
-
requestOptions:
NumbersClient.RequestOptions
-
-
client.numbers.get({ ...params }) -> unknown
-
-
-
Get details of a specific phone number.
Returns the phone number, its assigned AI agent, provider ID, country, and current status.
-
-
-
await client.numbers.get({ number_id: "number_id" });
-
-
-
request:
AgentlineApi.GetNumbersRequest
-
requestOptions:
NumbersClient.RequestOptions
-
-
client.numbers.reassign({ ...params }) -> unknown
-
-
-
Reassign a phone number to a different AI agent.
Moves an existing phone number from one AI agent to another. The target agent must not already have an active number assigned. The phone number remains active — only the agent ownership changes.
-
-
-
await client.numbers.reassign({ number_id: "number_id", agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.ReassignNumbersRequest
-
requestOptions:
NumbersClient.RequestOptions
-
-
client.webhooks.list({ ...params }) -> unknown
-
-
-
List the account's per-agent webhook configuration(s).
Secrets are masked. Pass
agent_idto inspect a single agent's webhook. The full secret is only ever shown once, on the POST that creates/replaces it.
-
-
-
await client.webhooks.list();
-
-
-
request:
AgentlineApi.ListWebhooksRequest
-
requestOptions:
WebhooksClient.RequestOptions
-
-
client.webhooks.set({ ...params }) -> AgentlineApi.WebhookCreated
-
-
-
Create or replace an agent's webhook.
The configured URL receives ALL of that agent's event types — call lifecycle (
call.received,call.completed,call.failed), SMS (sms.received), and future events — as signed JSON POSTs. Each agent may have at most one webhook; POSTing again replaces it.agent_id: the agent whose events this webhook receives (required).secret: HMAC signing secret. Omit to auto-generate.
The response returns the full
secretonce — store it to verify the signature header on deliveries.
-
-
-
await client.webhooks.set({ url: "url", agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.WebhookConfig
-
requestOptions:
WebhooksClient.RequestOptions
-
-
client.webhooks.delete({ ...params }) -> unknown
-
-
-
Remove an agent's webhook. No events for that agent will be delivered via HTTP afterwards; they remain available via GET /v1/events (the mailbox).
-
-
-
await client.webhooks.delete({ agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.DeleteWebhooksRequest
-
requestOptions:
WebhooksClient.RequestOptions
-
-
client.webhooks.test({ ...params }) -> unknown
-
-
-
Fire a signed
webhook.testevent to the agent's webhook.Uses the exact same event bus (publish_event) that real telephony events use, so a successful delivery confirms the entire pipeline is wired correctly. Returns 404 if no webhook is configured for the agent.
-
-
-
await client.webhooks.test({ agent_id: "agent_id" });
-
-
-
request:
AgentlineApi.TestWebhooksRequest
-
requestOptions:
WebhooksClient.RequestOptions
-
-