Send events
Create an event with POST /v1/events. Hookline queues the event and delivers it to every endpoint subscribed to its type.
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Event name, such as invoice.paid |
payload | object | Yes | JSON body that receivers get |
idempotency_key | string | No | Prevents duplicate events on retries |
Example request
- curl
- Node.js
- Python
curl -X POST https://api.hookline.example/v1/events \
-H "Authorization: Bearer $HOOKLINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"invoice.paid","payload":{"invoiceId":"inv_1042"}}'
const event = await hookline.events.create({
type: 'invoice.paid',
payload: { invoiceId: 'inv_1042' },
});
event = hookline.events.create(
type="invoice.paid",
payload={"invoiceId": "inv_1042"},
)
Response
A successful request returns 202 Accepted:
{
"id": "evt_8f2a91",
"status": "queued"
}
Idempotency
Send the same idempotency_key twice and Hookline creates one event. Keys expire after 24 hours.
Retry schedule
If an endpoint doesn't return a 2xx status code, Hookline retries the delivery.
| Attempt | Delay after previous attempt |
|---|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 10 minutes |
| 4 | 1 hour |
| 5 | 6 hours |
After the last attempt, Hookline marks the delivery as failed. You can replay failed events from the dashboard.