Assign Resource to WhatsApp number

View as MarkdownOpen in Claude
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](/docs/apis/rest/whatsapp/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](/docs/platform/voice/whatsapp/enable-voice). #### 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](/docs/platform/your-signalwire-api-space).

Authentication

AuthorizationBasic
SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ```

Path parameters

idstringRequiredformat: "uuid"
The unique identifier of the Resource.

Request

This endpoint expects an object.
whatsapp_number_idstringRequiredformat: "uuid"

The SignalWire ID of the WhatsApp number, as returned by List WhatsApp numbers.

handlerenumRequired

Whether the Resource handles the number’s calling or messaging traffic.

Response

The request has succeeded and a new resource has been created as a result.
Application Addressobject
OR
Room Addressobject
OR
Call Addressobject

Errors

401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error