Webhook Deliveries

Deliveries of events to a webhook endpoint.

created_at
datetime

The ISO 8601 datetime at which the webhook event was created

Example: "2020-04-11 15:48:11.642000+00:00"
endpoint_id
string

Duffel's unique identifier for the related webhook

Example: "end_0000A3tQSmKyqOrcySrGbo"
event_id
string

Duffel's unique identifier for the related webhook event

Example: "wev_0000A3tQSmKyqOrcySrGbo"
id
string

Duffel's unique identifier for the webhook delivery

Example: "del_0000A3tQSmKyqOrcySrGbo"
live_mode
boolean

The live mode that the webhook was created in. It will only receive events for that same live mode. For example, you won't receive order.created events for orders that you created in the sandbox, if your webhook is for live_mode: true.

Example: true
response_body
string

The response body

Example: "{}"
response_status_code
number

The response status code

Example: 200
type
string

The type of the related webhook event

Example: "order.created"
url
string

The URL where the delivery was sent

Example: "https://www.example.com:4000/webhooks"

Retrieve a paginated list of webhook deliveries

Query parameters

limit
integer

The maximum number of records to return per page. Defaults to 50. May be set to any integer between 1 and 200. For more information on how to paginate through records, see the Pagination section.

Example: 1
Default value: 50
before
string

A cursor pointing to the next page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
after
string

A cursor pointing to the previous page of records. For more information on how to paginate through records, see the Pagination section.

Example: "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
created_at
object

Filters the returned webhook deliveries by creation datetime.

type
string

Filters webhook deliveries by the type of their related webhook event.

Example: "order.created"
delivery_success
boolean

Webhook deliveries will be included if they were successful.

Example: true
endpoint_id
string

Filters webhook deliveries by the ID of the related webhook endpoint.

Example: "end_0000A3tQSmKyqOrcySrGbo"

Endpoint

GET https://api.duffel.com/air/webhooks/deliveries

Request

curl -X GET --compressed "https://api.duffel.com/air/webhooks/deliveries?limit=1&before=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&after=g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB=&created_at=undefined&type=order.created&delivery_success=true&endpoint_id=end_0000A3tQSmKyqOrcySrGbo" \
-H "Accept: application/json" \
-H "Accept-Encoding: gzip" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"meta": {
"limit": 50,
"after": "g2wAAAACbQAAABBBZXJvbWlzdC1LaGFya2l2bQAAAB="
},
"data": [
{
"url": "https://www.example.com:4000/webhooks",
"type": "order.created",
"response_status_code": 200,
"response_body": "{}",
"live_mode": true,
"id": "del_0000A3tQSmKyqOrcySrGbo",
"event_id": "wev_0000A3tQSmKyqOrcySrGbo",
"endpoint_id": "end_0000A3tQSmKyqOrcySrGbo",
"created_at": "2020-04-11 15:48:11.642000+00:00"
}
]
}

Retrieves a webhook delivery by its ID

URL parameters

id
stringrequired

Duffel's unique identifier for the webhook event

Example: "wev_0000A3tQSmKyqOrcySrGbo"

Endpoint

GET https://api.duffel.com/air/webhooks/deliveries/{id}

Request

curl -X GET --compressed "https://api.duffel.com/air/webhooks/deliveries/{id}" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v2" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"data": {
"url": "https://www.example.com:4000/webhooks",
"type": "order.created",
"response_status_code": 200,
"response_body": "{}",
"live_mode": true,
"id": "del_0000A3tQSmKyqOrcySrGbo",
"event_id": "wev_0000A3tQSmKyqOrcySrGbo",
"endpoint_id": "end_0000A3tQSmKyqOrcySrGbo",
"created_at": "2020-04-11 15:48:11.642000+00:00"
}
}