Use this when you bring your own telephony. Register the call first, then have your PBX dial the returned sip_uri within 5 minutes. The agent joins when the SIP call arrives. A registered call that nobody dials in time ends with registered_call_timeout.
Request#
Body#
| Field | Type | Required | Description |
|---|---|---|---|
agent_id |
string | Yes | Agent that answers the call. |
agent_version |
integer or string | No | A number, or latest, latest_published or an environment tag name. Default: latest version. |
from_number |
string | No | Caller number, stored on the call. |
to_number |
string | No | Called number, stored on the call. |
direction |
string | No | inbound or outbound. Default inbound. |
metadata |
object | No | Any JSON stored on the call. Default {}. |
retell_llm_dynamic_variables |
object | No | Values for {{variables}}. Non-string values are stored as JSON strings. Default {}. |
Example request#
curl -X POST "https://api.tried.com.au/v2/register-phone-call" \
-H "Authorization: Bearer $TRIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent_3f9a1c0b2d4e5f6a7b8c9d0e",
"from_number": "+61298765432",
"to_number": "+61291234567",
"direction": "inbound"
}'const res = await fetch("https://api.tried.com.au/v2/register-phone-call", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"agent_id": "agent_3f9a1c0b2d4e5f6a7b8c9d0e",
"from_number": "+61298765432",
"to_number": "+61291234567",
"direction": "inbound"
}),
});
const data = await res.json();import os, requests
res = requests.post(
"https://api.tried.com.au/v2/register-phone-call",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
json={
"agent_id": "agent_3f9a1c0b2d4e5f6a7b8c9d0e",
"from_number": "+61298765432",
"to_number": "+61291234567",
"direction": "inbound",
},
)
data = res.json()Response#
201 Created with the call object (call_status: "registered") and sip_uri.
{
"call_id": "call_4d5e6f7a8b9c0d1e2f3a4b5c",
"call_type": "phone_call",
"agent_id": "agent_3f9a1c0b2d4e5f6a7b8c9d0e",
"agent_version": 4,
"call_status": "registered",
"direction": "inbound",
"from_number": "+61298765432",
"to_number": "+61291234567",
"metadata": {},
"retell_llm_dynamic_variables": {},
"collected_dynamic_variables": {},
"start_timestamp": null,
"end_timestamp": null,
"duration_ms": null,
"transcript": "",
"transcript_object": [],
"transcript_with_tool_calls": [],
"disconnection_reason": null,
"call_analysis": null,
"latency": {},
"call_cost": null,
"sip_uri": "sip:call_4d5e6f7a8b9c0d1e2f3a4b5c@sip.tried.local"
}| Field | Type | Description |
|---|---|---|
sip_uri |
string | sip:{call_id}@{sip host}. The host is the server's LIVEKIT_SIP_URI (default sip.tried.local). Route the call here within 5 minutes. |
When the SIP call arrives, the workspace concurrency limit is checked. If it is full, the call ends with concurrency_limit_reached.
Errors#
| Status | When |
|---|---|
400 |
Validation failed, or a version reference is unknown. |
401 |
Missing or invalid API key. |
402 |
Credit exhausted, budget reached or invoice overdue. |
403 |
The key's IP allowlist or scopes reject the request. This route needs the calls scope. |
404 |
The agent or version does not exist. |
422 |
Register-call SIP routing is not configured on the server (REGISTER_CALL_ALLOWED_ADDRESSES, or REGISTER_CALL_AUTH_USERNAME and REGISTER_CALL_AUTH_PASSWORD). The call is ended with sip_routing_error. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.
Compatibility notes#
POST /register-phone-call is an alias. Tried routes registered calls by SIP URI, which is why the response includes sip_uri.