Skip to main content

Agents, voice calls, and chats

Configure an agent​

Multi-prompt agents are being retired

UponAI is retiring multi-prompt agents (LLMs with states) in favor of conversation flow agents. Creating them ends December 15, 2026, and editing ends February 1, 2027. Single-prompt and conversation flow agents are not affected. See the multi-prompt agents deprecation notice for the timeline and migration steps.

List your workspaces, then inspect available voices and LLM configurations. Create or update an agent with the supported response-engine configuration. Conversation-flow agents use the corresponding flow resource. Read the generated schemas for each engine variant.

Read an existing configuration before making a partial update. Publishing a version changes the configuration used by subsequent calls; verify the workspace and draft version first.

Select agent languages​

Set language to a locale string for one language, or an ordered array for multiple languages. This works with both LLM and conversation-flow agents in any workspace. Use the agent create/update endpoint, not the LLM or flow endpoint. Chat agents accept the same language field.

{
"workspaceId": 58,
"language": ["es-ES", "en-US"]
}

Send this body to PATCH /api/agents/{agentId}?version={draftVersion} (or /api/chat-agents/{agentId} for chat). The first locale is the voice pronunciation fallback. Choose only the languages needed by your callers. Your voice, pinned voice model, and speech recognition configuration must support the whole set; unsupported combinations return an error. The language update does not select a different voice for you.

Use at least one distinct supported locale. Empty arrays, duplicate or unsupported locales, and null are rejected. Omit the field to preserve languages on update; creation defaults to en-US. Responses can contain either a string or an array. Read the updated draft to verify the selection, then publish through your normal version workflow. In the editor, select the language checkboxes and Apply; the conversation-flow editor also requires its normal draft save.

await client.updateAgent({
path: { agentId },
query: { version: draftVersion },
body: { workspaceId: 58, language: ['es-ES', 'en-US'] },
});

Versions and environment tags​

The version publish operations for voice and chat agents accept an optional environmentTags array of existing tags, such as ["prod"], to point at the version after it is published. Publishing alone does not move tags. When environmentTags is sent, the response is the published agent plus environmentTagUpdate with moved tag names and failed entries (tag and error); the publish still succeeds if a tag move fails.

Deleting a version that an environment tag points to returns 409. Move or unassign the tag first. See Environment tags and dynamic variables for tag rules, per-tag dynamic variables, and examples.

Start a voice call​

Use POST /api/v1/calls/initiate with the agent, source number, and destination specified by its request schema. This places a real call and may incur charges. Use a dedicated test agent and a destination you control when validating an integration.

Read the resulting call with the call-detail endpoint or use the call-history endpoints. A successful creation response is not proof of completed audio or the desired conversation outcome.

For browser voice sessions, use POST /api/v1/calls/web and handle the returned session credentials as sensitive, short-lived access information.

Chat lifecycle​

Create a chat with a chat agent, send messages through the chat-completions endpoint, inspect the session, and end it when the workflow is complete. Outbound SMS can contact a real recipient; confirm your test target before sending.

Webhook events​

See the Webhooks overview for payload examples, authentication, receiver code, and troubleshooting.

Configure a receiving URL and select events in the agent's webhook settings. Voice agents support the same events with either an LLM or a conversation-flow engine:

EventWhen it is sent
call_startedA call connects and begins.
call_endedA call finishes or fails.
call_analyzedPost-call analysis is available.
transcript_updatedA new transcript turn is available, including the final update.
transfer_startedA transfer attempt begins.
transfer_bridgedThe transfer connects.
transfer_cancelledThe attempt is cancelled or fails to connect.
transfer_endedThe transfer leg ends.

Chat agents support chat_started, chat_ended, and chat_analyzed in their chat settings. Transcript updates are optional and can arrive repeatedly during one call. Transfer events retain destination and transfer-option details when present. Optional voice events follow your saved selections: selecting enables them and deselecting removes them from the subscription. They use the same platform proxy, branding rules, and configured webhook authentication as the existing events. Handle deliveries idempotently, while allowing multiple transcript updates and transfer attempts for the same call.

Publishing or opening an agent version preserves your receiving URL and selected events. If an event subscription changes on a draft, publish and assign that version to the relevant phone numbers before expecting the new events there. Browser demo calls and public API web sessions use the saved event selections. Your receiving URL is separate from the platform's delivery endpoint.

API and SDK configuration​

Webhook persistence and typed event selections are supported by the API and the 0.1.3 SDK and MCP packages.

Set webhook_url to your receiving endpoint. The platform saves this destination and uses its proxy for delivery. webhook_events controls customer forwarding; platform lifecycle processing continues independently. Omitted fields are preserved on PATCH; webhook_events: [] disables customer event delivery and webhook_url: null clears the destination. Creation defaults to the three lifecycle events for the agent channel if events are omitted.

curl -X PATCH 'https://api.upon-ai.com/api/v1/agents/agent_example?version=3' \
-H "Authorization: Bearer $UPONAI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"workspaceId":123,"webhook_url":"https://example.com/hooks/voice","webhook_events":["call_ended","call_analyzed","transcript_updated","transfer_started","transfer_ended"]}'
await client.updateAgent({
path: { agentId: 'agent_example' },
query: { version: 3 }, // Your editable version.
body: {
workspaceId: 123,
webhook_url: 'https://example.com/hooks/voice',
webhook_events: ['call_ended', 'transcript_updated', 'transfer_ended'],
},
});
const saved = await client.getAgent({
path: { agentId: 'agent_example' },
query: { workspaceId: 123, version: 3 },
});
// saved.webhook_url is your destination; saved.webhook_events is your selection.

Use updateChatAgent with chat_started, chat_ended, and/or chat_analyzed for chat agents. Voice and chat event types are separate SDK enums. The same fields are accepted during agent creation. A 400 means an invalid destination or event selection; a 409 means the selected published version needs an editable draft before subscriptions can change. A 502 indicates subscription readback failed and customer settings were not saved. A destination-only change can save against a published version if its proxy and subscriptions already match.

After saving, read the agent back. Customer destination and selections are agent-level settings, so historical version responses show the current saved customer settings. Publish the edited draft separately to activate subscription changes, and verify phone assignments use that version.

MCP reads show webhook_events and webhook_configured. Destination URLs and webhook authentication values are omitted from summaries. Version 0.1.3 adds updateAgentWebhookSettings and updateChatAgentWebhookSettings as optional write capabilities. Enable only the needed tool through UPONAI_MCP_WRITE_OPERATIONS; provide workspaceId, agentId, optional version, the webhook fields to change, and confirm: true. These tools do not publish agent versions.

Phone assignments​

Manage number assignments in the dashboard. The current public contract does not expose the dashboard-only number-management routes. Inbound schedules and default agents remain independent of outbound assignments.

Browser call connections​

Creating a web call returns callId, accessToken, transport, iceServers, and expiresAt. Pass the transport and ICE configuration to your browser voice client along with the call ID and connection token. Connection tokens are short-lived credentials; do not log them or put them in URLs. Existing create-call request fields remain supported. Retrieve the call by ID for its current status, transcript, and analysis after connection.

Updating call metadata and privacy​

The call-update operation routes metadata changes according to the current call state. Ongoing calls use live updates; completed calls update the stored record. A call that is still connecting returns HTTP 409, so retry after its state changes. During an ongoing call, privacy settings can become more restrictive but cannot be relaxed. optOutSensitiveDataStorage: true selects storage of basic attributes only. Dynamic-variable changes belong to the live-call operation.

UponAI translates supported legacy agent model and analysis prompt fields to the current execution format. Custom analysis fields are preserved when only an analysis prompt changes. Retired model identifiers resolve to their supported successors; read the saved configuration back to see the effective model.

Conversation-flow pagination​

Conversation-flow lists retain their JSON array response. Read X-Has-More and X-Pagination-Key from the response headers, then pass the cursor as paginationKey on the next request. The SDK exposes these headers through the optional onResponse callback as hasMore and paginationKey; its paginator passes this metadata as the third argument to next. MCP flow-list results include items, has_more, and pagination_key directly.

Search documentation

Type to filter pages. Use ↑ ↓ to choose, then Enter to open.

0 matching pages
AI questions are sent only when you select Ask AI or press Enter on it. Don’t include API keys or customer data.