Deliver an inbound webhook
The URL you give a provider for a routine's webhook trigger. The request is verified with the trigger's `verify` scheme (B3OS HMAC `B3OS-Signature: t=<unix>,v1=<hex>`, or the GitHub, Stripe, Slack or Standard Webhooks signature, or a generic HMAC header) with a ±5 minute timestamp window where the scheme has one, and deduplicated for 24 hours by the trigger's `dedupe` key (by default the provider's delivery ID: `X-GitHub-Delivery`, the Stripe event `id`, the Slack `event_id`, `webhook-id`, or for `b3os` the `Idempotency-Key` header, else the signature; `hmac_sha256` triggers must set `dedupe`); a duplicate answers 202 with `deduplicated: true` and the first delivery's run. No API key is used: the unguessable hook ID plus the signature authenticate it. When the trigger's `if` is false the delivery is acknowledged and starts nothing. If the node is down, the edge stores the delivery durably and replays it in order. On a replay the signed timestamp is checked against the time the edge received the delivery (the edge signs that time), so a delivery queued during an outage is not refused as stale. A 5xx answer means "retry later" and the edge keeps the delivery; 2xx and 4xx answers are final.
/v1/routines/hooks/{hook_id}
Path Parameters
hook_id
string
required
path
"hk_01m5t3r2qwz23751t0x74bhahz"Header Parameters
B3OS-Signature
string
optional
header
"t=1793001600,v1=8f2c6c0f0d7a3e4b5a6978c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f60718293a4b"Request Body
application/jsonResponses
application/jsonobject
string
REQUIRED
hook_deliveryhook_id
string
REQUIRED
delivery_id
string
REQUIRED
run_id
string | null
REQUIRED
deduplicated
boolean
REQUIRED
curl -X POST 'https://beta-api.b3os.org/v1/routines/hooks/hk_01m5t3r2qwz23751t0x74bhahz' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "action": "opened", "number": 42}'
const response = await fetch('https://beta-api.b3os.org/v1/routines/hooks/hk_01m5t3r2qwz23751t0x74bhahz', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "action": "opened", "number": 42 })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://beta-api.b3os.org/v1/routines/hooks/hk_01m5t3r2qwz23751t0x74bhahz', headers=headers, json={ "action": "opened", "number": 42})print(response.json())
{ "object": "hook_delivery", "hook_id": "hk_01m5t3r2qwz23751t0x74bhahz", "delivery_id": "evt_01m5t4p5ycda35cq27epnbfqhe", "run_id": "run_01m5t40dnvfxq40j1zrjj42gpg", "deduplicated": false}
Try this endpoint
/v1/routines/hooks/{hook_id}