Skip to main content

Create a WhatsApp channel

With this endpoint, you will be able to create a new WhatsApp channel in your account.

Parameters

These parameters should be sent as a JSON payload in the request body.

FieldDescriptionExample values
phone_numberThe number you want to connect to 2Chat+18647351567
friendly_nameA name or alias for the numberMy business number

Invocation

curl -X POST --location 'https://api.p.2chat.io/open/whatsapp/channel/create' \
--header 'Content-Type: application/json' \
--header 'X-User-API-Key: your_api_key_here' \
--data '{
"phone_number": "+18647351567",
"friendly_name": "Testing number creation"
}'

Response

If the number didn't exist and the creation was successful, you will see the following output and immediately after the number will try to connect and generate a QR code that you will need to scan.

To get that QR code information you need to call the Channel Status Endpoint using the UUID value (WPNf3ea6c85-0dca-4d8a-a9a6-2b918f59cc97) you obtained in this step.

tip

You can also get the UUID of a number you want to manipulate with the List Numbers Endpoint.

{
"success": true,
"channel": {
"id": "WPNf3ea6c85-0dca-4d8a-a9a6-2b918f59cc97",
"uuid": "WPNf3ea6c85-0dca-4d8a-a9a6-2b918f59cc97",
"friendly_name": "Testing number creation now",
"phone_number": "+18647351566",
"iso_country_code": "US",
"pushname": null,
"server": null,
"platform": null,
"connection_status": "D",
"enabled": true,
"is_business_profile": false,
"channel_type": "WW",
"sync_contacts": false,
"timezone": "America/New_York",
"lang": "en",
"created_at": "2023-10-12T17:43:58Z",
"updated_at": null
}
}