Delete a channel
Removes the channel from the workspace and unassigns its agent. If it was still connected, it is disconnected first. From that moment it no longer appears in list channels, and getting, changing, or disconnecting it answers 404 CHANNEL_NOT_FOUND.
If you only want it to stop receiving messages for a while, disconnect it instead.
Mailboxes (Gmail, Outlook, or on your domain) are removed in Platica: they answer 409 MANAGE_IN_PLATICA with the link in details.manageUrl.
Deleting a web chat also deletes its configuration and page. Your site's code stops working. It has the same effect as delete a web chat.
Example
curl -X DELETE https://api.platic.ai/v1/channels/$CHANNEL_ID \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.channels.delete("channel_123"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
channelId | string | Channel id or its prefixedChannelId | ✓ |
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
workspace | string | Only if your credential has several workspaces: which one the channel is in | — |
Response
{
"status": "success",
"message": "Channel removed from the workspace",
"data": {
"id": "104857362918475",
"deleted": true,
"nextStep": "Removed from this workspace and its agent unassigned: it no longer appears among the channels. To use it again, start a connection of the same type with POST /v1/channels/connections."
}
} Response fields
| Field | Type | Description |
|---|---|---|
id | string | Id of the channel you removed |
deleted | boolean | Always true |
nextStep | string | English text that says what comes next. Do not program against its wording |
Errors
Deleting again a channel you already removed answers the same, deleted: true: you can repeat the call if it failed.
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | Your credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available lists the ones you can use |
401 | UNAUTHENTICATED / CREDENTIAL_REVOKED | The credential is missing, invalid, or no longer covers this workspace |
403 | FORBIDDEN | The credential does not have write access to Integrations |
403 | INSUFFICIENT_SCOPE | The OAuth token does not have platica:write |
404 | CHANNEL_NOT_FOUND | The channel never existed in this workspace |
404 | NOT_FOUND | You sent connections as channelId. To cancel a connection, use cancel a connection |
409 | MANAGE_IN_PLATICA | It is a mailbox (or an internal Platica assistant): it is removed in Platica. The link is in details.manageUrl |
409 | WEBCHAT_CONFLICT | The web chat cannot be deleted in its current state |
| varies | CHANNEL_DELETE_FAILED | The channel could not be removed. Try again |
503 | OPERATION_UNCONFIRMED | Platica could not confirm the result. List the channels before retrying |
Messages that come from Platica (details.message) are in Spanish; code against details.code.
It cannot be undone with the API. To use that number, page, or mailbox again, connect it again and choose the agent that answers it again. To have a chat on your site again, create a new web chat.
Notes
- Needs a workspace API key, or an OAuth token with write access to Integrations and the
platica:writescope.