Get Webhook Subscription
Retrieves a specific webhook subscription by ID.
Endpoint
GET /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 retrieve. |
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": true,
"created_at": "2025-03-29T16:00:00Z",
"updated_at": "2025-03-29T16:00:00Z"
}
}
Note: For security reasons, the webhook secret is masked in the response.
Error Responses
| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - You don't have permission to access 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 GET \
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('GET', 'https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456', [
'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', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Available Events
Here are all the available webhook events:
| Event | Description |
|---|---|
shipping_channel.created | Fires when a new shipping channel is created |
shipping_channel.updated | Fires when a shipping channel is updated |
shipping_channel.deleted | Fires when a shipping channel is deleted |
shipping_channel.validated | Fires when a shipping channel is successfully validated |
shipping_channel.status_changed | Fires when a shipping channel's status changes |
tracking_parcel.created | Fires when a new tracking parcel is created |
tracking_parcel.updated | Fires when a tracking parcel is updated |
tracking_parcel.deleted | Fires when a tracking parcel is deleted |
tracking_parcel.status_changed | Fires when a tracking parcel's status changes |