Skip to main content

List Webhook Subscription Logs

Retrieves a paginated list of webhook delivery logs for your webhook subscriptions.

Endpoint

GET /v1/webhook-subscriptions/{id}/logs

Path Parameters

ParameterTypeDescription
idstringThe ID of the webhook subscription to retrieve logs for.

Query Parameters

ParameterTypeDescription
pageintegerPage number for pagination. Default is 1.
per_pageintegerNumber of items per page. Default is 15. Maximum is 100.

Response

200 OK

{
"data": [
{
"id": "whl_123456",
"webhook_subscription_id": "wh_123456",
"event_type": "tracking_parcel.status_changed",
"status": "success",
"url": "https://example.com/webhooks/shipping-channels",
"request_headers": {
"Content-Type": "application/json",
"X-Shipping-Channels-Event": "tracking_parcel.status_changed",
"X-Shipping-Channels-Delivery": "whl_123456",
"X-Shipping-Channels-Signature": "sha256=..."
},
"request_body": {
"id": "evt_123456",
"created_at": "2025-04-07T12:00:00Z",
"type": "tracking_parcel.status_changed",
"data": {
"tracking_parcel": {
"id": "tp_123456",
"tracking_number": "1234567890",
"shipping_channel_id": "ch_123456",
"status": "delivered",
"previous_status": "in_transit",
"created_at": "2025-04-06T10:00:00Z",
"updated_at": "2025-04-07T12:00:00Z"
}
}
},
"response_status": 200,
"response_body": "{\"received\":true}",
"duration_ms": 123,
"error_message": null,
"created_at": "2025-04-07T12:00:01Z"
},
{
"id": "whl_123457",
"webhook_subscription_id": "wh_123456",
"event_type": "tracking_parcel.created",
"status": "failed",
"url": "https://example.com/webhooks/shipping-channels",
"request_headers": {
"Content-Type": "application/json",
"X-Shipping-Channels-Event": "tracking_parcel.created",
"X-Shipping-Channels-Delivery": "whl_123457",
"X-Shipping-Channels-Signature": "sha256=..."
},
"request_body": {
"id": "evt_123457",
"created_at": "2025-04-07T11:00:00Z",
"type": "tracking_parcel.created",
"data": {
"tracking_parcel": {
"id": "tp_123456",
"tracking_number": "1234567890",
"shipping_channel_id": "ch_123456",
"status": "pending",
"created_at": "2025-04-07T11:00:00Z",
"updated_at": "2025-04-07T11:00:00Z"
}
}
},
"response_status": 0,
"response_body": null,
"duration_ms": 3000,
"error_message": "Connection timeout",
"created_at": "2025-04-07T11:00:03Z"
}
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://api.shipping-channels.com/v1/webhook-subscription-logs",
"per_page": 15,
"to": 2,
"total": 2
},
"links": {
"first": "https://api.shipping-channels.com/v1/webhook-subscription-logs?page=1",
"last": "https://api.shipping-channels.com/v1/webhook-subscription-logs?page=1",
"next": null,
"prev": null
}
}

### Error Responses

| Status Code | Description |
|-------------|-------------|
| 401 | Unauthorized - Invalid or missing API key |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong on our end |

## Example Request

### cURL

```bash
curl -X GET \
"https://api.shipping-channels.com/v1/webhook-subscriptions/wh_123456/logs" \
-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/logs', [
'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/logs', {
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));

Log Retention

Webhook subscription logs are retained for 30 days. After that, they are automatically deleted.