---
docId: doc_95c2422ca9484930a5badd6619e7a305
title: Delete a channel
description: "Remove a channel from the workspace, disconnecting it if necessary."
api:
  group: canales
  auth: bearer
  operations:
    - operationId: deleteChannel
      method: DELETE
      path: '/v1/channels/{channelId}'
      postmanName: Delete a channel
---

<script>
  import { Ways, Note, Collapsible } from '$lib/components';
</script>

# 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](/api-reference/channels/list), 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](/api-reference/channels/disconnect) 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](/api-reference/web-chats/delete).

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X DELETE https://api.platic.ai/v1/channels/$CHANNEL_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.channels.delete("channel_123");
```

</Ways.Way>
</Ways>

## 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

```json
{
  "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

<Collapsible summary="Show error codes and fixes">

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](/api-reference/channels/connections/cancel) |
| `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](/api-reference/channels/list) before retrying |

Messages that come from Platica (`details.message`) are in Spanish; code against `details.code`.

<Note type="warning">

It cannot be undone with the API. To use that number, page, or mailbox again, [connect it again](/api-reference/channels/connections/create) and choose the agent that answers it again. To have a chat on your site again, [create a new web chat](/api-reference/web-chats/create).

</Note>

</Collapsible>

## Notes

- Needs a workspace API key, or an OAuth token with write access to Integrations and the `platica:write` scope.
