GET /v1/events returns.
Make an endpoint
secret is shown only here. Keep it to check signatures.
eventslists the types to send. A type can be exact (ask.done), a group (ask.*), or"*"for every type.workspace.*events are about the workspace, not a browser: its plan changed, a payment failed, Free’s hours ran out (the types). Theirbrowseris null, and an endpoint made for one browser doesn’t get them.- A workspace has at most 10 endpoints, on every plan, Free included (Plans and limits).
- The address must use https, and resolve to a public address.
- In a team, every member sees the team’s endpoints. A member changes and deletes the endpoints they made, and owners and admins any of them (403
role_too_lowotherwise). When a member leaves or is removed, the endpoints they made for the team are deleted with their keys.
GET /v1/webhook_endpointslists your endpoints, andGET /v1/webhook_endpoints/{id}shows one, with itslast_delivery.PATCH /v1/webhook_endpoints/{id}changesurl,eventsordescription.DELETE /v1/webhook_endpoints/{id}deletes an endpoint.
Browsers coming and going
browser.created and browser.deleted tell your backend when a browser starts and ends, whoever made or deleted it: your backend, a member in the console, or the deletion of a whole batch.
browser.deletedcomes once the browser’s profile and files are gone, which can be a few seconds afterDELETEanswered 202. It has the browser’s id andexternal_id, so a receiver finds its own user, and nothing else of it: no name and no metadata, since the event outlives the browser. It stays inGET /v1/eventsfor 24 hours, as long as a delivery waits, and goes at once when the workspace is deleted.browser.createdhas the browser’smetadatatoo.- Every event names its browser in
browser, with itsexternal_id, so a receiver finds its own user from any event alone. - An endpoint filtered to one browser gets that browser’s
browser.deletedtoo, and goes a minute later.
Check the signature
Every POST has these headers:
The HMAC covers the string
<t>.<body> under your secret. Compute it over the raw body, before any JSON parsing, and refuse a t older than a few minutes:
Delivery
- Answer with any 2xx status within 10 seconds.
- An endpoint gets its events one at a time, in order of their ids. The next goes as soon as the one before is answered, so answer first and do the work after: a receiver that takes 200 ms to answer gets at most 5 events a second, and the rest wait in line.
- Any other answer, or none, holds the endpoint: the same event is tried again after 30 s, 2 min, 10 min, 30 min, then every 2 h, and the events after it wait behind it. Once it gets a 2xx, the ones waiting go at once.
- An event that waits 24 hours without a 2xx is given up, and so is the oldest when 5,000 wait for one endpoint. The endpoint’s
last_delivery.errorthen says so. - Deliveries that wait survive Hotkey’s restarts and deploys: the next server sends them, in order. Only a crash of Hotkey’s server can lose the ones of its last moment.
- An event can arrive twice, for example when a deploy cut a delivery off before its answer came. Use
Hotkey-Event-Idto skip duplicates. - Every event also stays in
GET /v1/events. A receiver that keeps the lastevt_id it saw can read anything it missed from there, with that id asstarting_after.