Sign inGet started

Update a call

Update an active call resource. You can use this request to do additional actions:
  • You can use this request to hangup the call by setting status to completed
  • It can also be used to update the callFlow of the call. Commands of the new callFlow will be executed after the Patch.

CallFlowCommand

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:
  - answer
  - hangup
  - playback
  - say
  - gather
  - record
  - bridge
  - pause
  - ringing
PATCH
/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}
Update a call
请求载荷
status
string
Possible values: completed
callFlow
array of object
显示子参数
callFlow.command
string
Possible values: answer, hangup, playback, say, gather, record, bridge, pause, ringing
callFlow.options
object
显示子参数
callFlow.conditions
array of object
显示子参数
callFlow.conditions.variable
string
Possible values: keys, speech
callFlow.conditions.operator
string
Possible values: eq, ne, ==, !=, contains
callFlow.conditions.value
string
响应载荷
id
string
必填
channelId
string
必填
from
string
必填
to
string
必填
originator
object
必填
显示子属性
originator.contact
object
显示子属性
originator.contact.id
string
必填
originator.contact.identifierKey
string
必填
originator.contact.identifierValue
string
必填
originator.number
object
必填
显示子属性
originator.number.type
string
必填
Possible values: pstn, sip, webrtc
originator.number.number
string
必填
originator.number.anonymous
boolean
originator.number.callerIdName
string
originator.number.identity
string
originator.number.countryIsoCode
string
originator.number.pstnNumberType
string
receiver
object
必填
显示子属性
receiver.contact
object
显示子属性
receiver.contact.id
string
必填
receiver.contact.identifierKey
string
必填
receiver.contact.identifierValue
string
必填
receiver.number
object
必填
显示子属性
receiver.number.type
string
必填
Possible values: pstn, sip, webrtc
receiver.number.number
string
必填
receiver.number.anonymous
boolean
receiver.number.callerIdName
string
receiver.number.identity
string
receiver.number.countryIsoCode
string
receiver.number.pstnNumberType
string
parentId
string
direction
string
必填
Possible values: incoming, outgoing
status
string
必填
Possible values: accepted, starting, ringing, ongoing, completed, busy, no-answer, failed, cancelled, scheduled
reason
string
type
string
必填
Possible values: pstn, sip, webrtc
duration
integer
hangupCauseCode
integer
hangupSource
string
Possible values: callee, caller, api, timeout, media-timeout, none
hangupSipCode
string
createdAt
string
必填
updatedAt
string
必填
ringingAt
string
answeredAt
string
endedAt
string
scheduledFor
string
callFlow
object
显示子属性
callFlow.id
string
callFlow.commands
array of object
显示子属性
callFlow.commands.id
string
callFlow.commands.callId
string
callFlow.commands.callFlowId
string
callFlow.commands.status
string
callFlow.commands.command
string
callFlow.commands.conditions
array of object
显示子属性
callFlow.commands.conditions.variable
string
Possible values: keys, speech
callFlow.commands.conditions.operator
string
Possible values: eq, ne, ==, !=, contains
callFlow.commands.conditions.value
string
notification
object
显示子属性
notification.url
string
qualityInsights
object
显示子属性
qualityInsights.mos
string
qualityInsights.pdd
string
sipInsights
object
显示子属性
sipInsights.hangupSipCode
string
sipInsights.edgeRegion
string
sipInsights.providerName
string
sipInsights.userAgent
string
sipInsights.remoteSignallingIp
string
sipInsights.remoteMediaIp
string
amdResult
object
显示子属性
amdResult.result
string
Possible values: human, machine, noSpeech, beep, unknown
amdResult.speech
string
amdResult.locale
string
sipType
string
Possible values: elastic, byoc, forward
tags
array of string
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.
代码示例
curl -X PATCH 'https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}' \
  -H 'Authorization: AccessKey YOUR_ACCESS_KEY'

Example 1: Update a call by answering

代码示例
curl -X PATCH "https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/calls/{channelId}" \
     -H "Authorization: AccessKey YOUR_SECRET_TOKEN"

Example 2: Update a call by sending ringing, pause for 2 seconds, answer and play an announcement

代码示例
curl -X PATCH "https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/calls/{channelId}" \
     -H "Authorization: AccessKey YOUR_SECRET_TOKEN"