Update a call

Update an active call resource. You can use this request to do additional actions:

  • It can also be used to update the callFlow of the call. Commands of the new callFlow will be executed after the Patch.

Update call status

Check bellow the available call status.

 status:
    type: string
    nullable: true
    enum:
      - completed

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

Update call

patch

Update a call

Authorizations
Path parameters
workspaceIdstring · uuidRequired

The ID of the workspace

callIdstring · uuidRequired

The ID for a call

channelIdstring · uuidRequired

The ID for a channel

Body
statusstring · enum | nullableOptionalPossible values:
Responses
202
Call update accepted
application/json
patch
PATCH /workspaces/{workspaceId}/channels/{channelId}/calls/{callId} HTTP/1.1
Host: 
Authorization: Bearer jwt
Content-Type: application/json
Accept: */*
Content-Length: 135

{
  "status": "completed",
  "callFlow": [
    {
      "command": "answer",
      "options": {},
      "conditions": [
        {
          "variable": "keys",
          "operator": "eq",
          "value": "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-05-09T04:44:47.695Z",
  "updatedAt": "2025-05-09T04:44:47.695Z",
  "ringingAt": "2025-05-09T04:44:47.695Z",
  "answeredAt": "2025-05-09T04:44:47.695Z",
  "endedAt": "2025-05-09T04:44:47.695Z",
  "scheduledFor": "2025-05-09T04:44:47.695Z",
  "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"
  ]
}

Example 1: Update a call by answering

curl -X "PATCH" "https://nest.messagebird.one/workspaces/8bc02f53-87ac-48d2-b4fd-c2cf856a305f/channels/3fa85f64-5717-4562-b3fc-2c963f66afa6
/calls/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
     -H 'Authorization: Bearer {Token}'

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

curl -X "PATCH" "https://nest.messagebird.one/workspaces/8bc02f53-87ac-48d2-b4fd-c2cf856a305f/channels/3fa85f64-5717-4562-b3fc-2c963f66afa6
/calls/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
     -H 'Authorization: Bearer {Token}'

Last updated

Was this helpful?