Skip to content
For LLMsView as Markdown·

API Reference

Complete reference for all OneHazel API endpoints.

Base URL

https://api.onehazel.com/

All endpoints are Supabase Edge Functions served from this base URL. Append the function name and path to this URL.

Authentication

All API endpoints require authentication via the Authorization header:

Authorization: Bearer oh_live_YOUR_API_KEY

See Authentication for details on creating and managing API keys.

Response format

All endpoints return JSON responses with a consistent structure:

Success:

json
{
  "success": true,
  "data": { ... }
}

Error:

json
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description"
  }
}

Rate limiting

Rate limits are per operator — a single ceiling shared across all of your API keys (issuing more keys does not raise it) — token-bucket with a 60-second window, and are enforced per commercial plan. When exceeded, the API returns HTTP 429 with:

  • Retry-After header indicating seconds to wait
  • resetAt field in the response body with an ISO 8601 timestamp

Ingest ceilings

Planingest:realtime (per-event writes)ingest:batch (bulk endpoints)Effective event throughput
Free trial250 req/min30 req/min~250 events/sec (batch)
Grow500 req/min60 req/min~500 events/sec (batch)
Scale2,500 req/min300 req/min~2,500 events/sec (batch)
Enterprise10,000 req/min (higher negotiated per contract)1,200 req/min10,000 events/sec+ supported

API, gateway & workflow ceilings

BucketFree trialGrowScaleEnterprise
api:read600/min6,000/min30,000/min150,000/min
api:write300/min3,000/min15,000/min75,000/min
gateway:execute (outbound /gateway/*)300/min3,000/min15,000/min75,000/min
ingest:read600/min3,000/min15,000/min75,000/min
workflow:ai30/min120/min600/min3,000/min

Analytics limits are flat across plans: 200 req/min read, 5 req/min export, 1 req/min refresh.

Headroom. Ceilings are per operator and apply across every key you issue, so adding keys does not increase throughput — move up a plan (Grow → Scale → Enterprise) for a higher ceiling, and prefer the batch endpoints (up to ~6× cheaper per request than realtime writes). For a large one-off backfill, contact us for temporary uplift. If your operator record has no plan set (or during a transient lookup blip) the platform falls back to conservative default ceilings rather than over-throttling. Honour Retry-After; don't stack your own backoff on top.

API groups

Data Ingestion — operator-data-api

Push entities, events, and states into OneHazel.

MethodEndpointDescription
GET/operator-data-api/templatesList available data templates
GET/operator-data-api/settingsGet template and retention config
PUT/operator-data-api/settingsSet template and retention config
POST/operator-data-api/entitiesCreate or update an entity
GET/operator-data-api/entities/:externalIdGet an entity
DELETE/operator-data-api/entities/:externalIdSoft-delete entity (GDPR)
POST/operator-data-api/entities/:externalId/eventsRecord an event
GET/operator-data-api/entities/:externalId/eventsList entity events
PUT/operator-data-api/entities/:externalId/state/:keyUpdate a state snapshot
GET/operator-data-api/entities/:externalId/stateGet all states
GET/operator-data-api/entities/:externalId/state/:keyGet a single state
POST/operator-data-api/batch/entitiesBulk upsert entities (max 1000)
POST/operator-data-api/batch/eventsBulk insert events (max 5000)
POST/operator-data-api/batch/statesBulk upsert states (max 1000)
GET/operator-data-api/batch/jobs/:jobIdCheck batch job status

Gateway — gateway

Proxy requests through to supplier APIs with automatic auth and schema translation.

MethodEndpointDescription
POST/gatewayExecute a gateway operation

Webhooks — webhook-receiver

Receive inbound webhooks from external providers.

MethodEndpointDescription
POST/webhook-receiver/:connectionIdReceive a webhook

Analytics — analytics-api

Query aggregated analytics data.

MethodEndpointDescription
GET/analytics-api/analytics/kpisAggregate KPIs
GET/analytics-api/analytics/revenueRevenue time series
GET/analytics-api/analytics/playersPlayer list
GET/analytics-api/analytics/players/:idPlayer detail
GET/analytics-api/analytics/gamesGame performance
GET/analytics-api/analytics/providersPayment provider stats
POST/analytics-api/analytics/refreshRefresh materialized views

API Keys — api-keys

Manage your API keys.

MethodEndpointDescription
POST/api-keysCreate a new API key
GET/api-keysList API keys (masked)
PATCH/api-keysRename a key
DELETE/api-keys?id=...Revoke or delete a key

Team Management — onehazel-api

Manage organisation members and invites (the dashboard Team page). See the Team Management guide for the operator walkthrough.

MethodEndpointDescription
GET/operators/me/membersList org members
GET/operators/me/invitesList pending invites
POST/operators/me/invitesInvite a member
POST/operators/me/invites/:id/resendResend an invite
DELETE/operators/me/invites/:idRevoke an invite
PATCH/operators/me/members/:idChange role / reinstate
DELETE/operators/me/members/:idRevoke (suspend) a member
GET/invites/lookup?token=...Validate an invite (public)
POST/invites/acceptAccept an invite (public)