WhatsApp Routes

Assign Resource to WhatsApp number

Assigns an existing Resource as a WhatsApp number's calling or messaging handler, so every inbound call or message to the number runs that Resource. Find the number's ID with List WhatsApp numbers. A number that already has an Address for the chosen channel is re-pointed at the new Resource; an Address it holds for the other channel is removed, because a WhatsApp number holds one Address at a time. Calling also requires voice to be enabled on the number, as described in Enable voice on a WhatsApp number.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Voice, Messaging, Fax, or Video.

Learn more about API scopes.

post/api/fabric/resources/{id}/whatsapp_numbers

Path parameters

idstring uuid required

Universal Unique Identifier.

The unique identifier of the Resource.

Request body

whatsapp_number_idstring uuid required

Universal Unique Identifier.

handler'calling' | 'messaging' required

Sets the handler to handle incoming calls or messages.

Response

The request has succeeded and a new resource has been created as a result.

OR
OR

Example response

{
  "name": "justice-league",
  "display_name": "Justice League",
  "cover_url": "https://coverurl.com",
  "preview_url": "https://previewurl.com",
  "locked": true,
  "channels": {
    "audio": "/external/resource_name?channel=audio"
  },
  "created_at": "2024-05-06T12:20:00Z",
  "type": "app"
}

Changes

Changed in 1 of the 161 revisions of this API.1

Of the 161 revisions, 3 have a changelog that could not be searched.