Initiate an outbound call

In order to create an outbound call from a voice channel you can use this request. You can set a callFlow with commands to be executed after call is answered.

Call flow command initiate an outbound call

Check bellow the available commands when initiating an outbound call. In order to assess the options of each command, you may explore each command section.

type: string
enum:
  - hangup
  - playback
  - say
  - gather
  - record
  - bridge
  - pause

Create call

Create a channel call

post

/workspaces/{workspaceId}/channels/{channelId}/calls

Authorizations
Path parameters
workspaceIdstring · uuidrequired

The ID of the workspace

channelIdstring · uuidrequired

The ID for a channel

Body
fromstring
tostringrequired
ringTimeoutinteger · min: 3 · max: 120 · default: 30
maxDurationinteger · min: 1 · default: 14400
sendKeysstring · max: 20
Pattern: ^[0-9*#]+$
recordboolean
stereoboolean
scheduledForstring · date-time
notificationCallNotification
amdSettingsAmdSettings
tagsstring · min: 1 · max: 50[]

Tags to associate with the call. Tags are converted to lower case and tags that do not exist are automatically created. You can view your created tags in the UI. You can specify up to 10 tags per call.

recordStartstring · enum
Options: record-from-answer, record-from-ringing
flowStartstring · enum
Options: from-answer, from-ringing
callFlowCallFlowCommand[]
Responses
curl -L \
  --request POST \
  --url '/workspaces/{workspaceId}/channels/{channelId}/calls' \
  --header 'Authorization: Bearer jwt' \
  --header 'Content-Type: application/json' \
  --data '{"to":"text","ringTimeout":30,"maxDuration":14400,"notification":{},"amdSettings":{"enabled":false,"wordCount":5,"speechTimeout":3,"beepTimeout":30,"speechLocale":"en-US","ifMachineNotifyAfter":"wordCount"},"tags":[null],"recordStart":"record-from-answer","flowStart":"from-answer","callFlow":[{"command":"hangup","conditions":[{"variable":"keys","operator":"eq"}],"options":{"media":[null]}}]}'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "channelId": "123e4567-e89b-12d3-a456-426614174000",
  "from": "text",
  "to": "text",
  "originator": {
    "contact": {
      "id": "text",
      "identifierKey": "text",
      "identifierValue": "text"
    },
    "number": {
      "type": "pstn",
      "number": "text",
      "anonymous": true,
      "callerIdName": "text",
      "identity": "text",
      "countryIsoCode": "text",
      "pstnNumberType": "text"
    }
  },
  "receiver": {
    "contact": {
      "id": "text",
      "identifierKey": "text",
      "identifierValue": "text"
    },
    "number": {
      "type": "pstn",
      "number": "text",
      "anonymous": true,
      "callerIdName": "text",
      "identity": "text",
      "countryIsoCode": "text",
      "pstnNumberType": "text"
    }
  },
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "direction": "incoming",
  "status": "accepted",
  "reason": "text",
  "type": "pstn",
  "duration": 1,
  "hangupCauseCode": 1,
  "hangupSource": "callee",
  "hangupSipCode": "text",
  "createdAt": "2025-02-21T18:03:22.913Z",
  "updatedAt": "2025-02-21T18:03:22.913Z",
  "ringingAt": "2025-02-21T18:03:22.913Z",
  "answeredAt": "2025-02-21T18:03:22.913Z",
  "endedAt": "2025-02-21T18:03:22.913Z",
  "scheduledFor": "2025-02-21T18:03:22.913Z",
  "callFlow": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "commands": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "callId": "123e4567-e89b-12d3-a456-426614174000",
        "callFlowId": "123e4567-e89b-12d3-a456-426614174000",
        "status": "text",
        "command": "text",
        "conditions": [
          {
            "value": "text",
            "variable": "keys",
            "operator": "eq"
          }
        ]
      }
    ]
  },
  "notification": {
    "url": "text"
  },
  "qualityInsights": {
    "mos": "text",
    "pdd": "text"
  },
  "sipInsights": {
    "hangupSipCode": "text",
    "edgeRegion": "text",
    "providerName": "text",
    "userAgent": "text",
    "remoteSignallingIp": "text",
    "remoteMediaIp": "text"
  },
  "amdResult": {
    "speech": "text",
    "locale": "text",
    "result": "human"
  },
  "sipType": "elastic",
  "tags": [
    "text"
  ]
}

Example 1: Initiate an outbound call, play an announcement and hangup

curl -X POST "https://api.bird.com/workspaces/:workspaceId/channels/:channelId/calls" \
     -H 'Authorization: Bearer {Token}'

Example 2: Initiate an outbound call with TTS

curl -X POST "https://api.bird.com/workspaces/:workspaceId/channels/:channelId/calls \
     -H 'Authorization: Bearer {Token}'

Last updated

Was this helpful?