Docs menu

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_idstringrequired

    The line (prf_…).

Request body

  • strategy"team" | "team_first" | "ai_first" | "ai_after_hours" | "forward"

    team (default: ring every teammate's app for ring_seconds, then voicemail), team_first (team, then your voice agent, then voicemail), ai_first (your voice agent for ai_timeout_seconds, then the team, then voicemail), ai_after_hours (inside hours like team, outside like ai_first) or forward (ring forward_to, then voicemail).

  • forward_tostring or null

    For forward: the number calls ring, US or Canada in any common format. Kept when you switch to another strategy.

  • forward_secondsinteger or null

    How long forward_to rings before voicemail, 5–60 seconds (default 20).

  • endpoint_idstring or null

    The voice agent (vep_…) for the AI steps. Needed by every strategy but team and forward.

  • ring_secondsinteger or null

    How long the team's apps ring, 5–120 seconds.

  • ai_timeout_secondsinteger or null

    How long your voice agent has to answer, 3–60 seconds (default 10).

  • hoursobject or null

    Business hours for ai_after_hours: { timezone, days, start, end }, days 0 (Sunday) to 6, times HH:MM. Hours past midnight belong to the day they start.

    Fields of hours
    • timezonestringrequired

    • daysarray of integerrequired

    • startstringrequired

    • endstringrequired

  • voicemailobject

    { greeting, transcribe }: the text read before the beep (when there's no recorded greeting), and whether to transcribe voicemails.

    Fields of voicemail
    • greetingstring or null

    • transcribeboolean

Response

200 OKThe routing.

  • strategy"team" | "team_first" | "ai_first" | "ai_after_hours" | "forward"required

  • forward_tostring or nullrequired

  • forward_secondsinteger or nullrequired

  • endpoint_idstring or nullrequired

  • ring_secondsinteger or nullrequired

  • ai_timeout_secondsinteger or nullrequired

  • hoursobject or nullrequired

    Fields of hours
    • timezonestringrequired

    • daysarray of integerrequired

    • startstringrequired

    • endstringrequired

  • voicemailobjectrequired

    Fields of voicemail
    • greetingstring or nullrequired

    • transcribebooleanrequired

  • object"call_routing"required

  • profile_idstringrequired

    prf_…

Errors

StatusCodeMeans
409calling_not_set_upThe line has no calling.
400forward_loopForwarding there would send the call straight back to a line.
400forward_not_allowedCalls can't be forwarded to that number (emergency, premium or outside the US and Canada).
400invalid_numberThat isn't a phone number calls can go to.
400validation_failedA field is missing or invalid.
401unauthorizedThe API key is missing, unknown or revoked.
403insufficient_scopeThe API key lacks the scope this needs.
404not_foundNo such object, or the key can't see it.

Every error is { "error": { "code", "message" } }. All error codes.

Keys come with your first line.

Request an invite and we'll set up a line for your team. API access is part of every plan.

Request an invite