Skip to main content
POST
Make an AI phone call
Use this endpoint for a one-time call attempt. Requests are not queued for later execution. The agent’s outbound settings determine whether it uses a single number, a number from its BYOC pool, or its assigned SIP trunk. Pool calls prefer a regional number when available and use the SIP trunk selected for the pool. The pool must contain verified BYOC numbers from the same workspace. If its trunk is unavailable or invalid, the call cannot start. Pool retry settings apply to sequence phone steps; this endpoint makes one attempt. For scheduled or bulk calling, use the Sequences API. Check both the HTTP status and the response body. A successful request does not mean the recipient answered; a setup failure can appear in the response body. Pass parentSessionId to open the call as a sub-session of an existing session, for example the chat the call is about. The call then appears under that session in the inbox, and Call Finished workflows see the parent on the call’s session. The parent must belong to your organization; otherwise the response carries parent_session_not_found and no call is started. If the endpoint returns HTTP 429 or 503 with an outbound_call_* error, or 503 with outbound_number_setting_up (the agent’s number OpenCX provides is still being set up for outbound calls), no call was started for that request. The endpoint does not retry it automatically or provide a Retry-After header. Your application decides whether to try again later. If the contact restricted phone calls or the number is on the outbound blocklist, the endpoint returns HTTP 422 and no call is started. See refused sends. If the agent has no outbound route of its own, the endpoint returns HTTP 422 and no call is started. outbound_route_required means the agent needs an outbound route: assign a SIP trunk for its caller number, or pick a number OpenCX provides. outbound_number_not_ready means the agent’s number OpenCX provides is not ready for outbound calls yet; contact support. Every new request tries to finish that number’s setup again. Retrying after outbound_route_required does not change the result until the agent’s setup changes.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
phoneAgentId
string
required
contact
object
required
sessionCustomData
object

Custom attributes saved on the call session before the call starts, so workflows and webhooks that fire at call start already see them. Also surfaced to the AI agent as session context. Equivalent to the X-OPENCX-SESSION-CUSTOM-DATA header on inbound calls.

extraInstructions
string

Extra instructions for the AI agent, scoped to this call only. Appended to the agent instructions in a clearly-scoped block — they complement, never replace, the agent prompt.

Maximum string length: 10000
parentSessionId
string<uuid>

Open the call as a sub-session of this session. The call session then shows under it in the inbox and carries it as the parent in Call Finished workflows. The session must belong to the same organization; otherwise the request fails with parent_session_not_found.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Response

Default Response

error
object

Error details if the call failed

result
any

Raw call result from the provider

sessionId
string

ID of the session created for this call, available at dial time. Use it to correlate call webhooks (phone_call.started / phone_call.ended carry the same session_id) and to fetch the session — including its custom data — after the call.

callId
string

Provider call ID