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
baseUrl option — useful for testing.
Authentication
All requests require an API key in theAuthorization header:
API key types
Every key has the sametraffical_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 resolutionssdk:write— send eventsmgmt:read/mgmt:write/admin— read and modify configuration
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 — anerror 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 return429 with a RATE_LIMITED error code and a Retry-After header (currently 10 seconds). Two things to know:
GET /v1/config/:projectIdresponses are heavily cached at the edge — most SDK refreshes never reach an origin.POST /v1/eventsaccepts batches of up to 1000 events per request. Always batch; never send one event per request from a server.