Skip to main content

Webhook Service

Manages webhook delivery status and retry logic for asynchronous jobs.


Endpoints


Get Webhook Delivery Status

GET /webhooks/delivery/status/:requestId

Retrieve the delivery status and details for a specific webhook request.

Path Parameters

ParameterTypeRequiredDescriptionExample
requestIdstringYesThe request ID to check status for"req-123e4567-e89b-12d3-a456-426614174000"

Success Response

Returns delivery status and details.

{
"requestId": "req-123e4567-e89b-12d3-a456-426614174000",
"deliveryId": "del-789e4567-e89b-12d3-a456-426614174000",
"status": "delivered",
"attemptCount": 2,
"maxRetries": 5,
"lastError": null,
"lastAttemptAt": "2025-11-20T12:34:56.789Z",
"successAt": "2025-11-20T12:35:10.123Z",
"httpStatus": 200,
"webhookUrl": "https://client.example.com/webhook",
"createdAt": "2025-11-20T12:34:00.000Z",
"updatedAt": "2025-11-20T12:35:10.123Z"
}

Error Responses

  • 404 Not Found: No webhook delivery found for the given request ID

Get Failed Webhook Deliveries

GET /webhooks/delivery/failed

Retrieve webhook deliveries that failed after maximum retries.

Query Parameters

ParameterTypeRequiredDescriptionExample
limitnumberNoMaximum number of failed deliveries to return (default: 50, max: 200)50

Success Response

Returns a list of failed deliveries.

{
"count": 2,
"limit": 50,
"deliveries": [
{
"deliveryId": "del-789e4567-e89b-12d3-a456-426614174000",
"requestId": "req-123e4567-e89b-12d3-a456-426614174000",
"status": "failed",
"attemptCount": 5,
"lastError": "Timeout",
"lastAttemptAt": "2025-11-20T12:36:00.000Z",
"webhookUrl": "https://client.example.com/webhook",
"createdAt": "2025-11-20T12:34:00.000Z",
"updatedAt": "2025-11-20T12:36:00.000Z"
}
// ...more deliveries
]
}

Get Pending Webhook Retries

GET /webhooks/delivery/pending-retries

Retrieve webhook deliveries that are pending retry.

Success Response

Returns a list of pending retry deliveries.

{
"count": 1,
"deliveries": [
{
"deliveryId": "del-789e4567-e89b-12d3-a456-426614174000",
"requestId": "req-123e4567-e89b-12d3-a456-426614174000",
"status": "pending_retry",
"attemptCount": 3,
"maxRetries": 5,
"lastError": "Connection refused",
"webhookUrl": "https://client.example.com/webhook",
"createdAt": "2025-11-20T12:34:00.000Z"
}
// ...more deliveries
]
}

Error Format

All error responses follow this format:

{
"statusCode": "ERROR_CODE",
"error": ["Description of the error"],
"requestId": "72e32108-6260-45e9-bb12-325fe3b61e42",
"path": "endpoint path",
"timestamp": "2025-11-19T16:32:57.915Z"
}

Field Descriptions

FieldTypeDescription
deliveryIdstringUnique identifier for the webhook delivery
requestIdstringRequest ID associated with the webhook delivery
statusenumDelivery status (delivered, failed, pending_retry, not_found)
attemptCountnumberNumber of delivery attempts
maxRetriesnumberMaximum number of retry attempts allowed
lastErrorstringError message from last attempt (if any)
lastAttemptAtstringISO8601 timestamp of last delivery attempt
successAtstringISO8601 timestamp of successful delivery (if delivered)
httpStatusnumberHTTP status code from last attempt
webhookUrlstringTarget webhook URL
createdAtstringISO8601 timestamp of delivery creation
updatedAtstringISO8601 timestamp of last update

For enum values, see WebhookDeliveryStatus definition.