Skip to content

Deliveries API

Deliveries represent attempts to send webhooks to destinations.

Endpoints

MethodPathDescription
GET/api/deliveriesList deliveries
GET/api/deliveries/{id}Get delivery
POST/api/deliveries/{id}/retryRetry delivery
POST/api/deliveries/bulk-replayBulk replay deliveries

Delivery Object

json
{
  "id": "dlv_abc123",
  "eventId": "evt_xyz789",
  "destinationId": "dst_api123",
  "routeId": "rte_main456",
  "status": "delivered",
  "attemptCount": 1,
  "maxAttempts": 5,
  "latency": 245,
  "statusCode": 200,
  "requestHeaders": {
    "Content-Type": "application/json",
    "Authorization": "Bearer ***",
    "X-Webhook-ID": "evt_xyz789"
  },
  "responseHeaders": {
    "Content-Type": "application/json",
    "X-Request-ID": "req_abc"
  },
  "responseBody": "{\"received\": true}",
  "error": null,
  "event": {
    "id": "evt_xyz789",
    "sourceId": "src_github"
  },
  "destination": {
    "id": "dst_api123",
    "name": "Production API",
    "url": "https://api.yourapp.com/webhooks"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:01Z",
  "deliveredAt": "2024-01-15T10:30:01Z"
}

Status Values

StatusDescription
pendingAwaiting delivery
sentRequest sent, awaiting response
deliveredSuccessfully delivered (2xx response)
failedAll retry attempts exhausted
retryingWaiting to retry
circuit_openDelivery blocked by open circuit breaker
schema_failedPayload failed schema validation
partialDelivered to some destinations but not all

List Deliveries

http
GET /api/deliveries

Query Parameters

ParameterTypeDescription
pagenumberPage number (default: 1)
pageSizenumberItems per page (default: 20, max: 100)
eventIdstringFilter by event
destinationIdstringFilter by destination
routeIdstringFilter by route
statusstringFilter by status
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)

Example

bash
curl "https://api.hookbase.app/api/deliveries?status=failed&destinationId=dst_api" \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/deliveries?status=failed&destinationId=dst_api', {
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const { data } = await response.json();
python
import requests

response = requests.get(
  'https://api.hookbase.app/api/deliveries?status=failed&destinationId=dst_api',
  headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()['data']

Response

json
{
  "data": [
    {
      "id": "dlv_abc123",
      "eventId": "evt_xyz789",
      "destinationId": "dst_api123",
      "status": "failed",
      "attemptCount": 5,
      "maxAttempts": 5,
      "statusCode": 500,
      "error": "Internal Server Error",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total": 34,
    "page": 1,
    "pageSize": 20
  }
}

Get Delivery

http
GET /api/deliveries/{id}

Query Parameters

ParameterTypeDescription
includeAttemptsbooleanInclude all attempt details (default: false)

Example

bash
curl "https://api.hookbase.app/api/deliveries/dlv_abc123?includeAttempts=true" \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/deliveries/dlv_abc123?includeAttempts=true', {
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const data = await response.json();
python
import requests

response = requests.get(
  'https://api.hookbase.app/api/deliveries/dlv_abc123?includeAttempts=true',
  headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()

Response

json
{
  "id": "dlv_abc123",
  "eventId": "evt_xyz789",
  "destinationId": "dst_api123",
  "status": "delivered",
  "attemptCount": 2,
  "maxAttempts": 5,
  "latency": 180,
  "statusCode": 200,
  "attempts": [
    {
      "attemptNumber": 1,
      "startedAt": "2024-01-15T10:30:00Z",
      "completedAt": "2024-01-15T10:30:01Z",
      "statusCode": 503,
      "error": "Service Unavailable",
      "latency": 5023
    },
    {
      "attemptNumber": 2,
      "startedAt": "2024-01-15T10:30:02Z",
      "completedAt": "2024-01-15T10:30:02Z",
      "statusCode": 200,
      "error": null,
      "latency": 180
    }
  ],
  "requestHeaders": {
    "Content-Type": "application/json"
  },
  "responseHeaders": {
    "Content-Type": "application/json"
  },
  "responseBody": "{\"received\": true}",
  "deliveredAt": "2024-01-15T10:30:02Z"
}

Retry Delivery

Manually retry a failed delivery:

http
POST /api/deliveries/{id}/retry

INFO

This resets the attempt count and queues the delivery for immediate retry.

Example

bash
curl -X POST https://api.hookbase.app/api/deliveries/dlv_abc123/retry \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/deliveries/dlv_abc123/retry', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const data = await response.json();
python
import requests

response = requests.post(
  'https://api.hookbase.app/api/deliveries/dlv_abc123/retry',
  headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()

Response

json
{
  "message": "Delivery queued for retry",
  "deliveryId": "dlv_abc123",
  "status": "pending"
}

Bulk Replay

Replay multiple failed deliveries in a single request (up to 100).

http
POST /api/deliveries/bulk-replay

Request Body

FieldTypeRequiredDescription
deliveryIdsstring[]YesArray of delivery IDs to replay (max 100)

Example

bash
curl -X POST https://api.hookbase.app/api/deliveries/bulk-replay \
  -H "Authorization: Bearer whr_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "deliveryIds": ["dlv_abc123", "dlv_def456", "dlv_ghi789"]
  }'
javascript
const response = await fetch('https://api.hookbase.app/api/deliveries/bulk-replay', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer whr_your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    deliveryIds: ['dlv_abc123', 'dlv_def456', 'dlv_ghi789']
  })
});
const data = await response.json();
python
import requests

response = requests.post(
  'https://api.hookbase.app/api/deliveries/bulk-replay',
  headers={'Authorization': 'Bearer whr_your_api_key'},
  json={'deliveryIds': ['dlv_abc123', 'dlv_def456', 'dlv_ghi789']}
)
data = response.json()

Response

json
{
  "message": "Deliveries queued for replay",
  "queued": 3,
  "skipped": 0,
  "errors": []
}

INFO

Only deliveries with status failed or circuit_open can be replayed. Deliveries in other states are skipped.

Dead Letter Queue

Failed deliveries are moved to the dead letter queue for manual review.

List Dead Letter Items

http
GET /api/deliveries/dead-letter

Query Parameters

ParameterTypeDescription
pagenumberPage number
pageSizenumberItems per page
destinationIdstringFilter by destination
fromstringStart date
tostringEnd date

Example

bash
curl https://api.hookbase.app/api/deliveries/dead-letter \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/deliveries/dead-letter', {
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const { data } = await response.json();
python
import requests

response = requests.get(
  'https://api.hookbase.app/api/deliveries/dead-letter',
  headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()['data']

Response

json
{
  "data": [
    {
      "id": "dlq_abc123",
      "deliveryId": "dlv_xyz789",
      "eventId": "evt_main123",
      "destinationId": "dst_api",
      "error": "Connection timeout after 30000ms",
      "attemptCount": 5,
      "failedAt": "2024-01-15T10:35:00Z",
      "event": {
        "id": "evt_main123",
        "receivedAt": "2024-01-15T10:30:00Z"
      },
      "destination": {
        "id": "dst_api",
        "name": "Production API"
      }
    }
  ],
  "pagination": {
    "total": 12,
    "page": 1,
    "pageSize": 20
  }
}

Requeue Dead Letter Item

http
POST /api/deliveries/dead-letter/{id}/requeue

Example

bash
curl -X POST https://api.hookbase.app/api/deliveries/dead-letter/dlq_abc123/requeue \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/deliveries/dead-letter/dlq_abc123/requeue', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const data = await response.json();
python
import requests

response = requests.post(
  'https://api.hookbase.app/api/deliveries/dead-letter/dlq_abc123/requeue',
  headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()

Response

json
{
  "message": "Item requeued for delivery",
  "deliveryId": "dlv_new456"
}

Delete Dead Letter Item

http
DELETE /api/deliveries/dead-letter/{id}

Example

bash
curl -X DELETE https://api.hookbase.app/api/deliveries/dead-letter/dlq_abc123 \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/deliveries/dead-letter/dlq_abc123', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
python
import requests

response = requests.delete(
  'https://api.hookbase.app/api/deliveries/dead-letter/dlq_abc123',
  headers={'Authorization': 'Bearer whr_your_api_key'}
)

Response

204 No Content

Delivery Statistics

http
GET /api/deliveries/stats

Query Parameters

ParameterTypeDescription
periodstring1h, 24h, 7d, 30d
destinationIdstringFilter by destination

Response

json
{
  "total": 5230,
  "delivered": 5152,
  "failed": 78,
  "pending": 0,
  "successRate": 98.5,
  "avgLatency": 245,
  "p50Latency": 180,
  "p95Latency": 450,
  "p99Latency": 890,
  "period": "24h"
}

Error Responses

404 Not Found

Delivery not found:

json
{
  "error": "Not Found",
  "message": "Delivery with ID dlv_xyz not found",
  "code": "RESOURCE_NOT_FOUND"
}

409 Conflict

Cannot retry delivery:

json
{
  "error": "Conflict",
  "message": "Delivery is already pending or delivered",
  "code": "INVALID_STATE"
}

Released under the MIT License.