Contents
Purge Webhook - Plugixa Chat
DELETE /plugixa-chat/v1/webhooks/{id}/purge
Delete a webhook permanently. This cannot be undone.
Needs Plugixa Chat Pro. The signed-in user needs the plugixa_chat_delete capability. Administrators have it.
Purging does not need the trash first. It works on a live webhook as well as a trashed one.
Request
DELETE https://your-site.example/wp-json/plugixa-chat/v1/webhooks/3/purge
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The webhook’s id |
Responses
200 OK. The webhook is gone.
{
"success": true,
"data": {
"purged": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.purged |
boolean |
Always true |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_chat_not_found |
No webhook has this id. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-chat/v1/webhooks/3/purge" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/webhooks/3/purge');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-chat/v1/webhooks/3/purge', {
method: 'DELETE',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share