Skip to main content
A webhook endpoint is an https address of yours. Hotkey POSTs every event of the types you pick there, for every browser in the workspace of the key that made it. Each POST carries one event, the same object that GET /v1/events returns.

Make an endpoint

The secret is shown only here. Keep it to check signatures.
  • events lists 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). Their browser is 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_low otherwise). When a member leaves or is removed, the endpoints they made for the team are deleted with their keys.
Also available:
  • GET /v1/webhook_endpoints lists your endpoints, and GET /v1/webhook_endpoints/{id} shows one, with its last_delivery.
  • PATCH /v1/webhook_endpoints/{id} changes url, events or description.
  • 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.deleted comes once the browser’s profile and files are gone, which can be a few seconds after DELETE answered 202. It has the browser’s id and external_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 in GET /v1/events for 24 hours, as long as a delivery waits, and goes at once when the workspace is deleted.
  • browser.created has the browser’s metadata too.
  • Every event names its browser in browser, with its external_id, so a receiver finds its own user from any event alone.
  • An endpoint filtered to one browser gets that browser’s browser.deleted too, 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.error then 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-Id to skip duplicates.
  • Every event also stays in GET /v1/events. A receiver that keeps the last evt_ id it saw can read anything it missed from there, with that id as starting_after.