Skip to main content

Link Slack Channel to WhatsApp Group

This endpoint allows you to establish a connection between a Slack channel and a WhatsApp group. Once linked, messages sent in either platform will be synchronized to the other, creating a seamless communication bridge between Slack and WhatsApp.

Path Parameters

FieldDescriptionRequired
slack_channel_idThe ID of the Slack channel to linkYes
group_uuidThe UUID of the WhatsApp group to link (format: WAG{36} or WGP{36})Yes

Request Body

FieldDescriptionRequiredDefault
ignore_thread_messagesWhether to ignore thread messages in the synchronizationNofalse
display_slack_username_on_messageWhether to display the Slack username on messages sent to WhatsAppNotrue

Invocation

curl -X POST \
'https://api.p.2chat.io/open/slack/C1234567890/link-to-group/WAG1234567890' \
-H 'X-User-API-Key: your_api_key_here' \
-H 'Content-Type: application/json' \
-d '{
"ignore_thread_messages": false,
"display_slack_username_on_message": true
}'

Response

The API will respond with the link details if the invocation succeeded.

{
"success": true,
"data": {
"slack_channel_id": "C1234567890",
"whatsapp_group_uuid": "WAG1234567890",
"channel_uuid": "WPN1234567890",
"ignore_thread_messages": false,
"display_slack_username_on_message": true
}
}

Error Responses

Status CodeDescription
400Missing required fields: slack_channel_id, group_uuid are required
404Account not found
400Slack configuration not found
400Slack channel not found
400Slack configuration is disabled. Reason: {reason}
404WhatsApp group not found. Received group_uuid=[group_uuid]
400Slack channel is already linked to another WhatsApp group