Skip to content
Browse documentation

Reference

REST API

REST API reference for endpoints, events, deliveries, replays, and workspaces, with authentication, scopes, pagination, and error codes.

The API uses predictable resource URLs, JSON bodies, and bearer authentication. All requests must use HTTPS.

  • Base URL: https://api.hooks.events/v1
  • Authentication: Authorization: Bearer hks_...
  • Scopes: endpoints:read, endpoints:write, deliveries:read, deliveries:retry, history:purge, metrics:read, alerts:read, alerts:write, mcp:write.
  • Session-authenticated requests can select a workspace with X-Workspace-Id: <workspace-id>. Reads fall back to the caller’s own workspace when the id no longer belongs to them (stale localStorage); mutating requests return 403 AUTHORIZATION_DENIED instead of silently writing elsewhere.
  • Mutating requests with a body must send Content-Type: application/json.

Every operation below is generated from the OpenAPI 3.1 document at https://api.hooks.events/openapi.json. Browse it under OpenAPI operations or download the raw document and generate a client.

GET /v1/events accepts two content filters on top of endpointId, status, and cursor pagination:

  • q matches a substring in the inline payload or request headers (max 200 characters).
  • filter matches a field path: body.<path>=<value> or headers.<name>=<value>, up to 8 levels deep. Values compare as text, so body.amount=100 matches both 100 and "100". Quote values containing spaces: headers.x-label="needs review".
Terminal window
curl -H "Authorization: Bearer $HOOKS_API_KEY" \
"https://api.hooks.events/v1/events?q=ORD-1042&limit=20"
curl -H "Authorization: Bearer $HOOKS_API_KEY" \
"https://api.hooks.events/v1/events?filter=body.data.object.id=ch_123"

Both options scan stored JSON with SQLite LIKE/json_extract, so keep the result limit small and combine them with endpoint/status filters. Search only covers events whose payload is still stored inline; payloads moved to object storage by retention cannot be matched. A malformed field path returns 400 VALIDATION_ERROR.

  • API keys carry scopes. A key without the route’s scope gets 403 AUTHORIZATION_DENIED.
  • /v1/* allows 600 requests per minute per credential. Responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; over the limit you get 429 RATE_LIMIT_EXCEEDED with Retry-After.
  • Inbound /in/{publicId} requests are limited per endpoint and per workspace. A Free workspace that exhausts its lifetime grant gets 429 with x-quota-limit and an upgrade_url; /t/* and /inspect/* never consume quota.

GET https://api.hooks.events/openapi.json returns the OpenAPI 3.1 document that generates the table above. The sandbox callback endpoints under /callbacks/tasks/* are token-authenticated and intentionally excluded: they are called by run sandboxes, not by API clients.

Every workspace starts with one default environment, production. Endpoints and tasks accept environmentId to bind to another environment; null or omitted means the default. Environment-scoped secrets and variables override project-level rows of the same name.

  • A test event (POST /v1/endpoints/{id}/test-events), preview, or task run may pass a one-off environmentId; it overrides the endpoint/task binding for that request.
  • Deliveries and task runs expose environmentId; task-run views also include environmentName.
  • GET /v1/environments/{id}/resolved returns { secrets: [{ name, source, lastUsedAt }], variables: [{ name, value, source }] }, where source is environment or default. Secret values and ciphertext are never returned.
  • Variables are plaintext by design. A credential-looking variable name gets a warning on create; store credentials as secrets instead.
Terminal window
curl "https://api.hooks.events/v1/endpoints" \
-H "Authorization: Bearer $HOOKS_API_KEY"

Create an API key in Settings → API keys. Keys are scoped and can be revoked at any time.