Skip to main content

Toggle Webhook Subscription Active Status

Toggles the active status of a webhook subscription between active and inactive.

Endpoint

PATCH /v1/webhook-subscriptions/{id}/toggle-active

Authentication

API key required. Include it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Path Parameters

ParameterTypeDescription
idstringThe ID of the webhook subscription to toggle.

Response

200 OK

{
"data": {
"id": "wh_123456",
"name": "Shipping Channel Updates",
"url": "https://example.com/webhooks/shipping-channels",
"events": [
"shipping_channel.created",
"shipping_channel.updated",
"shipping_channel.deleted",
"shipping_channel.status_changed"
],
"secret": "••••••••••••••••",
"active": false,
"created_at": "2025-03-29T16:00:00Z",
"updated_at": "2025-03-29T16:00:00Z"
},
"message": "Webhook subscription deactivated successfully"
}

Error Responses

Status CodeDescription
401Unauthorized - Invalid or missing API key
403Forbidden - You don't have permission to toggle this webhook subscription
404Not Found - The specified webhook subscription could not be found
429Too Many Requests - Rate limit exceeded
500Server Error - Something went wrong on our end

Example Request

cURL

curl -X PATCH \
https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456/toggle-active \
-H "Authorization: Bearer YOUR_API_KEY"

PHP

<?php
$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456/toggle-active', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
],
]);

$data = json_decode($response->getBody(), true);

JavaScript

fetch('https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456/toggle-active', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));