Initiate an outbound call
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
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
curl -X POST "https://api.bird.com/workspaces/:workspaceId/channels/:channelId/calls" \
-H 'Authorization: Bearer {Token}'
{
"to": "+351000000000",
"callFlow": [
{
"command": "playback",
"options": {
"media": [
"https://www.media.com.com/audio/code1.wav",
"https://www.media.com.com/audio/code2.wav",
"https://www.media.com.com/audio/code3.wav",
"https://www.media.com.com/audio/code4.wav",
],
"pauseMilliseconds": 100
}
},
{
"command": "hangup"
}
]
}
HTTP/1.1 202 Accepted
Content-Type: application/json; charset=UTF-8
Content-Length: 1041
Connection: close
Date: Thu, 29 Feb 2024 11:44:07 GMT
Messagebird-Request-Id: dfdc5b69-518f-4033-845b-cfd952ac1542
Vary: Origin
X-Cache: Miss from cloudfront
Via: 1.1 1d956df7e4e25ae74372a8b2c4cdb82e.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: FCO50-P1
Alt-Svc: h3=":443"; ma=86400
X-Amz-Cf-Id: 5q_MM0W4I4L4O1R4pwlJuNMd8IplyIR1_EiO-kpk0yiuxh9TRBVvPA==
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
Referrer-Policy: no-referrer
Content-Security-Policy: default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; object-src 'none'; media-src 'self'; frame-src 'self'; worker-src 'self' blob:; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self';
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Vary: Origin
{"id":"1e5e9219-2da2-4aa2-bf0f-8cc34775e6c0","channelId":"1499d657-31af-4ba0-b731-7eab3fb764be","originator":{"number":{"type":"pstn","number":"+3197058016631","countryIsoCode":"NL"}},"receiver":{"contact":{"id":"1fddcbcd-3ece-42da-82e1-ef48a8536b92","identifierKey":"phonenumber","identifierValue":"+351910648517"},"number":{"type":"pstn","number":"+351910648517","countryIsoCode":"PT"}},"from":"+3197058016631","to":"+351910648517","direction":"outgoing","status":"accepted","type":"pstn","duration":0,"callFlow":{"id":"004a540b-897b-494c-a176-d7aec51d0257","commands":[{"id":"a28a931e-191c-4f2e-afcb-fa940f8e3a8a","callId":"1e5e9219-2da2-4aa2-bf0f-8cc34775e6c0","command":"playback","status":"accepted","callFlowId":"004a540b-897b-494c-a176-d7aec51d0257"},{"id":"d6022794-1c8e-44ab-8a9b-4e2deb2bf3e7","callId":"1e5e9219-2da2-4aa2-bf0f-8cc34775e6c0","command":"hangup","status":"accepted","callFlowId":"004a540b-897b-494c-a176-d7aec51d0257"}]},"notification":{},"createdAt":"2024-02-29T11:44:07.74Z","updatedAt":"2024-02-29T11:44:07.74Z"}
curl -X POST "https://api.bird.com/workspaces/:workspaceId/channels/:channelId/calls \
-H 'Authorization: Bearer {Token}'
{
"to": "+351000000000",
"callFlow": [
{
"command": "say",
"options": {
"locale": "en-US",
"text": "Your TTS message here",
"voice": "female"
}
},
{
"command": "hangup"
}
]
}
HTTP/1.1 202 Accepted
Content-Type: application/json; charset=UTF-8
Content-Length: 1041
Connection: close
Date: Thu, 29 Feb 2024 11:44:07 GMT
Messagebird-Request-Id: dfdc5b69-518f-4033-845b-cfd952ac1542
Vary: Origin
X-Cache: Miss from cloudfront
Via: 1.1 1d956df7e4e25ae74372a8b2c4cdb82e.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: FCO50-P1
Alt-Svc: h3=":443"; ma=86400
X-Amz-Cf-Id: 5q_MM0W4I4L4O1R4pwlJuNMd8IplyIR1_EiO-kpk0yiuxh9TRBVvPA==
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
Referrer-Policy: no-referrer
Content-Security-Policy: default-src 'self'; style-src 'self'; script-src 'self'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; object-src 'none'; media-src 'self'; frame-src 'self'; worker-src 'self' blob:; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self';
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Vary: Origin
{"id":"1e5e9219-2da2-4aa2-bf0f-8cc34775e6c0","channelId":"1499d657-31af-4ba0-b731-7eab3fb764be","originator":{"number":{"type":"pstn","number":"+3197058016631","countryIsoCode":"NL"}},"receiver":{"contact":{"id":"1fddcbcd-3ece-42da-82e1-ef48a8536b92","identifierKey":"phonenumber","identifierValue":"+351910648517"},"number":{"type":"pstn","number":"+351910648517","countryIsoCode":"PT"}},"from":"+3197058016631","to":"+351910648517","direction":"outgoing","status":"accepted","type":"pstn","duration":0,"callFlow":{"id":"004a540b-897b-494c-a176-d7aec51d0257","commands":[{"id":"a28a931e-191c-4f2e-afcb-fa940f8e3a8a","callId":"1e5e9219-2da2-4aa2-bf0f-8cc34775e6c0","command":"playback","status":"accepted","callFlowId":"004a540b-897b-494c-a176-d7aec51d0257"},{"id":"d6022794-1c8e-44ab-8a9b-4e2deb2bf3e7","callId":"1e5e9219-2da2-4aa2-bf0f-8cc34775e6c0","command":"hangup","status":"accepted","callFlowId":"004a540b-897b-494c-a176-d7aec51d0257"}]},"notification":{},"createdAt":"2024-02-29T11:44:07.74Z","updatedAt":"2024-02-29T11:44:07.74Z"}
Create a channel call
The ID of the workspace
The ID for a channel
30
14400
^[0-9*#]+$
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.
POST /workspaces/{workspaceId}/channels/{channelId}/calls HTTP/1.1
Host:
Authorization: Bearer jwt
Content-Type: application/json
Accept: */*
Content-Length: 558
{
"from": "text",
"to": "text",
"ringTimeout": 1,
"maxDuration": 1,
"sendKeys": "text",
"record": true,
"recordStart": "record-from-answer",
"flowStart": "from-answer",
"stereo": true,
"callFlow": [
{
"command": "hangup",
"conditions": [
{
"variable": "keys",
"operator": "eq",
"value": "text"
}
],
"options": {
"media": [
"text"
],
"loop": 1,
"timeout": 1,
"pauseMilliseconds": 1
}
}
],
"scheduledFor": "2025-04-28T02:53:04.625Z",
"notification": {
"url": "text"
},
"amdSettings": {
"enabled": true,
"wordCount": 1,
"speechTimeout": 1,
"speechLocale": "en-US",
"beepTimeout": 1,
"ifMachineNotifyAfter": "beep"
},
"tags": [
"text"
]
}
{
"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-04-28T02:53:04.625Z",
"updatedAt": "2025-04-28T02:53:04.625Z",
"ringingAt": "2025-04-28T02:53:04.625Z",
"answeredAt": "2025-04-28T02:53:04.625Z",
"endedAt": "2025-04-28T02:53:04.625Z",
"scheduledFor": "2025-04-28T02:53:04.625Z",
"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": [
{
"variable": "keys",
"operator": "eq",
"value": "text"
}
]
}
]
},
"notification": {
"url": "text"
},
"qualityInsights": {
"mos": "text",
"pdd": "text"
},
"sipInsights": {
"hangupSipCode": "text",
"edgeRegion": "text",
"providerName": "text",
"userAgent": "text",
"remoteSignallingIp": "text",
"remoteMediaIp": "text"
},
"amdResult": {
"result": "human",
"speech": "text",
"locale": "text"
},
"sipType": "elastic",
"tags": [
"text"
]
}