Set call routing
PUT/v1/profiles/{profile_id}/call-routing
- Scope
calls:write
Replaces the routing. Fields left out take their defaults.
Parameters
Path
profile_idstringrequiredThe line (
prf_…).
Request body
strategy"team" | "team_first" | "ai_first" | "ai_after_hours" | "forward"team(default: ring every teammate's app forring_seconds, then voicemail),team_first(team, then your voice agent, then voicemail),ai_first(your voice agent forai_timeout_seconds, then the team, then voicemail),ai_after_hours(insidehoursliketeam, outside likeai_first) orforward(ringforward_to, then voicemail).forward_tostring or nullFor
forward: the number calls ring, US or Canada in any common format. Kept when you switch to another strategy.forward_secondsinteger or nullHow long
forward_torings before voicemail, 5–60 seconds (default 20).endpoint_idstring or nullThe voice agent (
vep_…) for the AI steps. Needed by every strategy butteamandforward.ring_secondsinteger or nullHow long the team's apps ring, 5–120 seconds.
ai_timeout_secondsinteger or nullHow long your voice agent has to answer, 3–60 seconds (default 10).
hoursobject or nullBusiness hours for
ai_after_hours:{ timezone, days, start, end }, days 0 (Sunday) to 6, timesHH:MM. Hours past midnight belong to the day they start.Fields of
hourstimezonestringrequireddaysarray of integerrequiredstartstringrequiredendstringrequired
voicemailobject{ greeting, transcribe }: the text read before the beep (when there's no recorded greeting), and whether to transcribe voicemails.Fields of
voicemailgreetingstring or nulltranscribeboolean
Response
200 OKThe routing.
strategy"team" | "team_first" | "ai_first" | "ai_after_hours" | "forward"requiredforward_tostring or nullrequiredforward_secondsinteger or nullrequiredendpoint_idstring or nullrequiredring_secondsinteger or nullrequiredai_timeout_secondsinteger or nullrequiredhoursobject or nullrequiredFields of
hourstimezonestringrequireddaysarray of integerrequiredstartstringrequiredendstringrequired
voicemailobjectrequiredFields of
voicemailgreetingstring or nullrequiredtranscribebooleanrequired
object"call_routing"requiredprofile_idstringrequiredprf_…
Errors
| Status | Code | Means |
|---|---|---|
| 409 | calling_not_set_up | The line has no calling. |
| 400 | forward_loop | Forwarding there would send the call straight back to a line. |
| 400 | forward_not_allowed | Calls can't be forwarded to that number (emergency, premium or outside the US and Canada). |
| 400 | invalid_number | That isn't a phone number calls can go to. |
| 400 | validation_failed | A field is missing or invalid. |
| 401 | unauthorized | The API key is missing, unknown or revoked. |
| 403 | insufficient_scope | The API key lacks the scope this needs. |
| 404 | not_found | No such object, or the key can't see it. |
Every error is { "error": { "code", "message" } }. All error codes.