Skip to main content

Create a Slack channel

This endpoint will let you create a new Slack channel, link it to a WhatsApp group, and add a user for bidirectional message synchronization.

Path Parameters

FieldDescriptionRequired
slack_channel_nameName of the Slack channel to create. Must contain only lowercase letters, numbers, hyphens, and underscores. Maximum length: 80 charactersYes
group_uuid_to_assignUUID of the WhatsApp group to link with the Slack channelYes
user_email_to_assignEmail of the user to add to the Slack channelYes

Invocation

curl --location --request POST 'https://api.p.2chat.io/open/slack/create-channel/my-channel/assign-to-group-uuid/WAG123456789/user-email-to-assign/user@example.com' \
--header 'X-User-API-Key: your_api_key_here'

Response

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

{
"success": true,
"data": {
"slack_channel_id": "C0123ABC456",
"slack_channel_name": "my-channel",
"whatsapp_group_uuid": "WAG123456789",
"user_linked_to_channel": "user@example.com"
}
}

Error Responses

Status CodeDescription
400Params missing. Received group_uuid_to_assign=[null]
400slack_channel_name can't contain special characters. Received slack_channel_name=[invalid-name]
400slack_channel_name can't be longer than 80 characters. Received slack_channel_name=[too-long-name]
400Channel is already assign to another channel [existing-channel]. Received group_uuid_to_assign=[group-uuid]
400Slack configuration is disabled. Reason: [reason]
400Error creating the channel. Received response=[error]
404Account is None. Please connect your account with Slack
404Group not found. Received group_uuid_to_assign=[group-uuid]
404Slack configuration not found. Please connect your account with Slack
500Something went wrong, please try again

Notes

  • The Slack channel name must follow Slack's naming conventions (lowercase letters, numbers, hyphens, and underscores only)
  • The WhatsApp group must exist and be accessible to your account
  • The user email must be a valid email address and must be on Your Workspace
  • Your account must have Slack integration properly configured and enabled
  • The WhatsApp group must not be already linked to another Slack channel