API Overview

Apex exposes a REST API for tracking events, managing experiments, resolving identities, and querying analytics. All endpoints are relative to your Apex host.

Base URL

https://app.apex.inc

For local development, use http://localhost:3000. Staging is https://staging.app.apex.inc.

Authentication

Apex supports two authentication methods depending on context.

Dashboard requests use the signed-in browser session. That is set automatically after sign-in.

API key

For server-to-server or SDK calls, pass a workspace or org key:

curl -H "x-api-key: apex_sk_..." https://app.apex.inc/api/v1/events

Or using the Authorization header:

curl -H "Authorization: Bearer apex_sk_..." https://app.apex.inc/api/v1/events

Keys:

PrefixUse
apex_sk_Org / server key. CI, webhooks, Server Events.
apex_uk_Personal user key. MCP and "act as me" tools.

Info

Public endpoints — /api/events (the snippet), /api/experiments/active, and /api/apex-js — do not require a key. Server-side truth events use POST /api/v1/events with apex_sk_.

Error format

All error responses follow a consistent JSON structure:

{
  "error": "Human-readable error message",
  "code": "VALIDATION_ERROR",
  "status": 400
}

Common status codes:

StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid credentials
403Forbidden — valid credentials but insufficient permissions
404Resource not found
429Rate limit exceeded
500Internal server error

Rate limiting

API-key traffic is limited per key. When you exceed the limit, the API returns 429 Too Many Requests with a Retry-After header.

Limits are per second and depend on the key. Do not bake a requests-per-minute table into a client. Batch events so one request carries many events.

Tip

Batch events using the SDK payload format. A single batch request counts as one request regardless of how many events it contains.

Content type

All request and response bodies use application/json. Set the Content-Type header on POST, PATCH, and DELETE requests.

Next steps