Skip to main content
The Traffical SDK API is served from sdk.traffical.io. SDKs use it to fetch config bundles, send events, and (in server evaluation mode) request resolutions. You can also call it directly for server-to-server integrations. This section covers the SDK runtime endpoints only: config, resolve, decide, and events. Project and organization management — creating parameters, layers, and policies — happens through the dashboard, the CLI, and the MCP server.

Base URL

You can override this in any SDK with the baseUrl option — useful for testing.

Authentication

All requests require an API key in the Authorization header:

API key types

Every key has the same traffical_sk_... prefix. What a key can do — and whether it is browser-safe — depends on its scopes, not its prefix:
  • sdk:read — fetch bundles, request resolutions
  • sdk:write — send events
  • mgmt:read / mgmt:write / admin — read and modify configuration
SDK keys are safe to include in client-side JavaScript: they can fetch the project’s bundle and send events, but cannot modify configuration in any way. Management keys can change configuration and must never ship in client code. A mgmt:read key gives AI agents a read-only connection to the MCP server; write tools require separate write scopes.

Managing keys

Create and revoke keys on your organization’s API Keys page in the dashboard (from the account menu). Keys can be scoped to a project, given an expiry, or revoked at any time.

Endpoints

Caching

GET /v1/config/:projectId is served with Cache-Control: public, max-age=60, must-revalidate and an ETag per bundle version. SDKs send If-None-Match on subsequent requests — unchanged bundles return 304 Not Modified with no body. Use the same pattern in any custom client that polls the bundle.

Error responses

All errors share a consistent shape — an error object with a stable machine-readable code and a human-readable message:
503 responses are always safe to retry: they mean nothing was stored or served, so a retry cannot duplicate data.

Rate limits

Limits are generous for SDK traffic and scale with your plan. Rate-limited requests return 429 with a RATE_LIMITED error code and a Retry-After header (currently 10 seconds). Two things to know:
  • GET /v1/config/:projectId responses are heavily cached at the edge — most SDK refreshes never reach an origin.
  • POST /v1/events accepts batches of up to 1000 events per request. Always batch; never send one event per request from a server.