Delete a web chat
SDK platic.webchats.delete()
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. Its settings remain saved, and you can turn it on by publishing it.
Example
curl -X DELETE https://api.platic.ai/v1/webchats/$WEBCHAT_ID \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.webchats.delete("webchat_123"); 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
{
"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 |
Warning
To install another chat, create a new one and paste its code. It will have a different public key.
Notes
- Deleting the channel 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:writescope.