Calls

Place an outbound call with a text-to-speech / IVR flow

place an outbound call that speaks text to the callee, plays hosted audio, and can collect keypad input and branch on it

post/calls

Request

  • Base URL
    https://api.commpeak.com/portal
  • URL
    https://api.commpeak.com/portal/calls
  • Auth
    API key in header Authorization

Request body

recipient_phonestring required

Number to call, E.164 (no leading "+").

senderstring required

Caller ID presented to the callee, E.164 (no leading "+"). Must be a verified caller ID of the account unless all caller IDs are allowed for it (see GET /portal/allowed_caller_ids).

voicestring nullable

Default voice model id for every say step (see GET /portal/calls/voices). Defaults to en_US-amy-medium upstream.

status_callback_urlstring nullable

URL notified when the call finishes. See docs/voice-call-backend.md for the payload.

Example request

{
  "flow": [
    {
      "action": "say",
      "text": "This is a call from CommPeak"
    },
    {
      "action": "say",
      "text": "A new incident has been created"
    },
    {
      "action": "say",
      "text": "To acknowledge press 1, to escalate press 2"
    },
    {
      "action": "gather",
      "callback_url": "https://demo.example.com/dtmf",
      "num_digits": 1,
      "on_digit": {
        "1": "acknowledged",
        "2": "escalate"
      },
      "on_timeout": "no-input",
      "timeout": 10
    },
    {
      "action": "say",
      "id": "no-input",
      "text": "You have not entered any input. Good bye"
    },
    {
      "action": "hangup"
    },
    {
      "action": "say",
      "id": "acknowledged",
      "text": "Thank you, this is acknowledged"
    },
    {
      "action": "hangup"
    },
    {
      "action": "playback",
      "id": "escalate",
      "url": "https://demo.example.com/escalation-notice.wav"
    },
    {
      "action": "dial",
      "recipient_phone": "12125551234"
    },
    {
      "action": "hangup"
    }
  ],
  "recipient_phone": "12125551234",
  "sender": "12125551200",
  "status_callback_url": "https://demo.example.com/call-status",
  "voice": "en_US-amy-medium"
}

Response

Successful Response

statusboolean required

Whether the call request was accepted.

call_uuidstring nullable

Identifier of the call; also sent on every callback.

call_statusstring nullable

Call state at acceptance, e.g. queued.

Example response

{
  "call_status": "queued",
  "call_uuid": "01d1e10f-9eb2-4543-a711-3707906010e2",
  "status": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.