Docs menu

Place a call

POST/v1/profiles/{profile_id}/calls

  • Scope calls:write
  • Idempotency-Key required

Calls to from the line's number; when they answer, connects your voice agent (endpoint_id) or a teammate's app (user_id). US and Canada only; emergency numbers never.

Idempotency: the Idempotency-Key header is required, like sends: a retry with the same key answers 200 with the same call and never places a second one.

Parameters

Path

  • profile_idstringrequired

    The line (prf_…).

Request body

  • tostringrequired

    The number to call: US or Canada, any common format.

  • endpoint_idstring

    Connect your voice agent (vep_…) when they answer. Give this or user_id.

  • user_idstring

    Ring a teammate's app (usr_…) and connect them when they answer. Give this or endpoint_id.

  • timeout_secondsinteger

    How long to ring, 5–60 seconds.

Response

200 OKA retry with the same Idempotency-Key: the same call.

  • idstringrequired

    cal_…

  • object"call"required

  • profile_idstringrequired

    prf_…

  • direction"inbound" | "outbound"required

  • originstringrequired

    pstn (an outside caller), browser, api, sip (your voice agent dialed out) or test.

  • fromstring or nullrequired

  • tostring or nullrequired

  • remote_numberstring or nullrequired

    The other party's number.

  • chat_idstring or nullrequired

    The chat with the same person, if there is one.

  • statusstringrequired

    queued, ringing, in_progress, completed, busy, no_answer, failed or canceled.

  • handled_bystring or nullrequired

    user:usr_…, voice_ai:vep_…, number:+1…, voicemail or team.

  • endpoint_idstring or nullrequired

  • started_attimestamp or nullrequired

  • answered_attimestamp or nullrequired

  • ended_attimestamp or nullrequired

  • duration_secinteger or nullrequired

  • billable_minutesinteger or nullrequired

    Rounded up per call.

  • voicemailobject or nullrequired

    A voicemail left on the call: GET its url with your key for the audio.

    Fields of voicemail
    • urlstringrequired

    • duration_secinteger or nullrequired

    • transcriptionstring or nullrequired

    • storedbooleanrequired

  • transfersarray of objectrequired

    Fields of transfers
    • tostringrequired

    • bystringrequired

    • atstringrequired

  • errorobject or nullrequired

    Fields of error
    • codestringrequired

    • messagestring or nullrequired

  • created_attimestamprequired

201 CreatedThe call, ringing.

  • idstringrequired

    cal_…

  • object"call"required

  • profile_idstringrequired

    prf_…

  • direction"inbound" | "outbound"required

  • originstringrequired

    pstn (an outside caller), browser, api, sip (your voice agent dialed out) or test.

  • fromstring or nullrequired

  • tostring or nullrequired

  • remote_numberstring or nullrequired

    The other party's number.

  • chat_idstring or nullrequired

    The chat with the same person, if there is one.

  • statusstringrequired

    queued, ringing, in_progress, completed, busy, no_answer, failed or canceled.

  • handled_bystring or nullrequired

    user:usr_…, voice_ai:vep_…, number:+1…, voicemail or team.

  • endpoint_idstring or nullrequired

  • started_attimestamp or nullrequired

  • answered_attimestamp or nullrequired

  • ended_attimestamp or nullrequired

  • duration_secinteger or nullrequired

  • billable_minutesinteger or nullrequired

    Rounded up per call.

  • voicemailobject or nullrequired

    A voicemail left on the call: GET its url with your key for the audio.

    Fields of voicemail
    • urlstringrequired

    • duration_secinteger or nullrequired

    • transcriptionstring or nullrequired

    • storedbooleanrequired

  • transfersarray of objectrequired

    Fields of transfers
    • tostringrequired

    • bystringrequired

    • atstringrequired

  • errorobject or nullrequired

    Fields of error
    • codestringrequired

    • messagestring or nullrequired

  • created_attimestamprequired

Errors

StatusCodeMeans
400idempotency_key_requiredA send or call came without an Idempotency-Key header.
409idempotency_key_reusedThe Idempotency-Key was used before for a different request. Nothing was sent.
403emergency_number_blockedEmergency and N11 numbers can't be called from a line.
403destination_not_allowedCalls go to US and Canadian numbers only.
402calling_not_subscribedThe line doesn't have Calling on its plan.
402spending_cap_reachedThe team has used its calling minutes for the month.
403fair_use_pausedOutgoing calls on this line are paused for the month (fair use).
409caller_id_unverifiedCalling on the line is still being set up.
409calling_not_set_upThe line has no calling.
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