This API is read-only and describes calls that already happened. To connect your own telephony platform to PolyAI, see the SIP Trunking API.
Endpoints
Both endpoints are also available as Data MCP tools:
get-call-sip-ladder and get-call-audio-quality.
Base URL and authentication
Send an account API key in theX-API-KEY header (Authorization: Bearer <key> is also accepted). The key needs read access to conversations. Create keys from the API Keys tab in Agent Studio; see API keys.
Keys are region-specific. Use the host of the region your account lives in.
Both endpoints accept an optional
project_id, the Agent ID shown in Agent Studio (PROJECT-xxxxxxxx). Use it to confirm a call belongs to a given agent; a call that does not belong to that agent returns 404. It is required when you authenticate with a personal access token (PAT) instead of an account API key.
Concepts
Call identifier
conversation_id is the call SID: the same conversation_id the Conversations API and the Traces API return for a voice call. A call is visible only to the account it belongs to; any other call returns 404.
Legs
One call usually involves several SIP dialogs, each with its own SIPCall-ID. The SIP endpoint returns every dialog it can link to the call as a leg: the carrier to PolyAI’s SIP edge, PolyAI’s SIP edge to the media server, and any further legs created by a transfer. Messages from all legs come back in one list, ordered by capture time, so you can read the call end to end.
A Call-ID is chosen by whoever starts the dialog, so two unrelated calls can occasionally share one. When a dialog’s Call-ID also appears on a call of another account, or of another agent when you pass project_id, that leg is left out, because PolyAI cannot tell whose messages are whose. If no leg remains, the call returns 404.
SIP messages
Each message has amethod: the request method (for example INVITE, BYE or REFER), OTHER for a method that is not a standard SIP method, or, for a response, the response code as a string (for example 180 or 200). Responses also carry response_code and reason, the standard phrase for that code; the phrase the remote party sent is not returned.
With include_sip_details=true, each message also carries selected details taken from its headers and body:
A leg’s
final_response is the first response of 200 or above to any request on that leg, not only to the INVITE. When a caller hangs up before the call is answered, the 200 that acknowledges the CANCEL arrives before the 487 that ends the INVITE, so final_response is 200. To see how a leg really ended, read its messages.
Audio quality
Audio quality comes from RTCP reports sent during the call. The API groups them into one stream per leg (call_id), reporting endpoint (ssrc) and source (source_ssrc), with:
packets_sent counts what the reporter sent, while the loss and jitter fields describe what it received from source_ssrc. Do not divide one by the other to get a loss rate; use fraction_lost_avg_pct and fraction_lost_max_pct.
Loss or jitter that is high on every stream points to the network or the carrier. If the streams are clean but the call still went badly, look at the agent with the Traces API.
Personal data
What the SIP endpoint returns depends on whether the API key can read personal data (PII). Without PII access:- Phone numbers in
from_userandto_userkeep only their last four digits, after***. A user part counts as a number when it holds a run of at least six digits once separators are ignored, whatever surrounds it, so+442079460142,tel:+44-20-7946-0142and%2B442079460142all become***0142. - Other user parts, such as a SIP username, become
***. Placeholders such asanonymous,private,restricted,unavailable,unknownandwithheldare returned as they are. - Network details (
src_ip,src_port,dst_ip,dst_portanduser_agent) arenull, on messages and on legs. - SIP details are limited to
reason_headersandrefer_status, even withinclude_sip_details=true.
Time windows
from and to are optional ISO 8601 query parameters that set the window in which PolyAI looks for the call. to defaults to now and from to 14 days before now.
Telephony data is kept for 14 days, the retention limit. A from earlier than that is raised to the limit, and a call older than that returns 404.
The window only locates the call. The messages and reports returned cover the call’s own time span, from 5 minutes before its first message to about 3 minutes after its last. Messages outside that span, such as those of a transfer leg that continues long after the main leg ends, are not returned, and truncated does not flag them.
Responses carry truncated. It is true when the cap of 2,000 SIP messages or 5,000 RTCP reports was reached within that span, and later messages or reports are missing.

