Skip to main content

Clear Webhook Subscription Logs

Clears all webhook delivery logs for a specific webhook subscription.

Endpoint​

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

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 clear logs for.

Response​

200 OK​

{
"message": "Webhook logs cleared successfully."
}

Error Responses​

Status CodeDescription
401Unauthorized - Invalid or missing API key
403Forbidden - You don't have permission to clear logs for 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 DELETE \
https://api.uniship.com/v1/webhook-subscriptions/wh_123456/logs \
-H "Authorization: Bearer YOUR_API_KEY"

PHP​

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

$response = $client->request('DELETE', 'https://api.uniship.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.uniship.com/v1/webhook-subscriptions/wh_123456/logs', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));