---
docId: doc_d9ca84d19e7a4652b31d31f94d4e7e71
title: Delete a web chat
description: "Delete a web chat, its settings, page, and images."
api:
  group: canales/webchat
  auth: bearer
  operations:
    - operationId: deleteWebchat
      method: DELETE
      path: '/v1/webchats/{webchatId}'
      postmanName: Delete a web chat
---

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

# Delete a web chat

Permanently delete the web chat, its settings, page, and images. It is also disconnected from its agent. Remove the code from your HTML because it will stop working.

To hide it temporarily, [turn it off](/api-reference/channels/disconnect). Its settings remain saved, and you can turn it on by [publishing it](/api-reference/web-chats/publish).

## Example

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

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

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

```ts
await platic.webchats.delete("webchat_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `webchatId` | string | Web chat id (`wc-…`) | ✓ |

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Only if your credential has several workspaces: which one the web chat is in | — |

## Response

```json
{
  "status": "success",
  "message": "Web chat deleted",
  "data": {
    "id": "wc-7Hq2LmN4pR8sT1vX",
    "deleted": true,
    "nextStep": "Deleted for good, with its configuration: the code pasted in sites and its page stop working, so take the code out of the site. To have a web chat again, create one with POST /v1/webchats."
  }
}
```

### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Id of the web chat you deleted |
| `deleted` | boolean | Always `true` |
| `nextStep` | string | English text that says what comes next. Do not program against its wording |

A missing web chat also returns `deleted: true`, whether it was deleted or never existed. You can repeat the call if it failed.

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | `webchatId` does not start with `wc-` |
| `403` | `FORBIDDEN` | The credential does not have write permission on Integrations |
| `503` | `WEBCHAT_SERVICE_UNAVAILABLE`, `WEBCHAT_SERVICE_TIMEOUT` | The web chat service did not respond. You can repeat the call |

<Note type="warning">

To install another chat, [create a new one](/api-reference/web-chats/create) and paste its code. It will have a different public key.

</Note>

## Notes

- [Deleting the channel](/api-reference/channels/delete) with `DELETE /v1/channels/{webchatId}` does the same.
- Needs a workspace API key, or an OAuth token with write access to Integrations and the `platica:write` scope.
