Webhook Endpoint Reference
List Webhooks
curl "https://api.oilpriceapi.com/v1/webhooks" \
-H "Authorization: Token YOUR_API_KEY"
Create Webhook
curl -X POST "https://api.oilpriceapi.com/v1/webhooks" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/oilpriceapi",
"events": ["price.updated", "alert.triggered"],
"description": "Production event receiver"
}'
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | HTTPS receiver URL |
events | array[string] | Yes | Event types to deliver |
description | string | No | Internal label |
secret | string | No | Custom signing secret when supported |
Get / Update / Delete
curl "https://api.oilpriceapi.com/v1/webhooks/wh_123" \
-H "Authorization: Token YOUR_API_KEY"
curl -X PATCH "https://api.oilpriceapi.com/v1/webhooks/wh_123" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
curl -X DELETE "https://api.oilpriceapi.com/v1/webhooks/wh_123" \
-H "Authorization: Token YOUR_API_KEY"
Delivery History
curl "https://api.oilpriceapi.com/v1/webhooks/wh_123/events" \
-H "Authorization: Token YOUR_API_KEY"
{
"status": "success",
"data": [
{
"id": "evt_123",
"type": "price.updated",
"status": "delivered",
"attempts": 1,
"last_attempt_at": "2026-07-15T14:30:03Z"
}
]
}
Test Delivery
curl -X POST "https://api.oilpriceapi.com/v1/webhooks/wh_123/test" \
-H "Authorization: Token YOUR_API_KEY"
Use test delivery before enabling a production alert or data-correction workflow.
Retry Policy
OilPriceAPI retries failed deliveries with backoff. Your endpoint should return 2xx only after accepting the event for durable processing.