Delete Webhook Subscription
Deletes a webhook subscription, preventing any further webhook notifications from being sent to the associated URL.
Endpoint
DELETE /v1/webhook-subscriptions/{id}
Authentication
API key required. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The ID of the webhook subscription to delete. |
Response
204 No Content
A successful deletion returns a 204 No Content response with no body.
Error Responses
| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - You don't have permission to delete this webhook subscription |
| 404 | Not Found - The specified webhook subscription could not be found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong on our end |
Example Request
cURL
curl -X DELETE \
https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456 \
-H "Authorization: Bearer YOUR_API_KEY"
PHP
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
],
]);
// 204 No Content response indicates success
$statusCode = $response->getStatusCode();
JavaScript
fetch('https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
})
.then(response => {
if (response.status === 204) {
console.log('Webhook subscription deleted successfully');
} else {
return response.json().then(data => Promise.reject(data));
}
})
.catch(error => console.error('Error:', error));
Implications of Deletion
When you delete a webhook subscription:
- No further webhook notifications will be sent to the associated URL
- All event subscriptions associated with the webhook subscription are removed
- Any logs associated with the webhook subscription are retained (but can be accessed through the webhook subscription logs endpoints)
- This action cannot be undone
If you want to temporarily stop receiving webhook notifications without deleting the webhook subscription, consider updating the webhook subscription's status to inactive instead of deleting it.
Alternative to Deletion
As an alternative to deletion, you can update the webhook subscription's status to inactive:
PUT /v1/webhook-subscriptions/{id}
{
"status": "inactive"
}
This allows you to reactivate the webhook subscription later if needed.