Deregister Webhook Endpoint
REST API endpoint to deregister and unsubscribe from webhooks in WSMS.
This endpoint allows you to deregister and unsubscribe from a webhook in WSMS. Use it when you no longer want to receive notifications through a registered webhook.
Endpoint
DELETE /wp-json/wpsms/v1/webhook
Authentication
WSMS supports Application Password authentication (WordPress 5.6+).
See Register Webhook Endpoint for authentication setup instructions.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_url | string | Yes | The webhook URL to deregister |
type | string | Yes | Event type: new_subscriber or new_sms |
Examples
cURL
curl --location --request DELETE 'https://site.com/wp-json/wpsms/v1/webhook?type=new_sms&webhook_url=https://your-webhook-url.com' \
--header 'Authorization: Basic YOUR_API_KEY'
PHP
<?php
$username = 'your-username';
$password = 'your-application-password';
$auth = base64_encode("$username:$password");
$webhook_url = urlencode('https://your-webhook-url.com');
$type = 'new_sms';
$url = "https://site.com/wp-json/wpsms/v1/webhook?type={$type}&webhook_url={$webhook_url}";
$args = array(
'method' => 'DELETE',
'headers' => array(
'Authorization' => 'Basic ' . $auth,
),
);
$response = wp_remote_request($url, $args);
Related
- Register Webhook Endpoint - Register new webhooks
Last updated: December 23, 2024