Skip to content

Config & evaluate API

These endpoints power flag delivery and evaluation. Which key each takes matters: use the narrowest key that works for the surface.

Base URL: https://statskit.ai/api/v1

EndpointKey
GET/POST /client-configcsk_live_… (client)
POST /exposurescsk_live_… (client)
GET /config, GET /config/version, GET /config/streamssk_live_… or vsk_live_… (server)
POST /evaluatessk_live_… or vsk_live_… (server)

GET /client-config

The browser-safe path. The server evaluates flags for the given context and returns only the resulting values (never targeting rules or segments), so the response is CDN-cacheable.

Query params: key (the csk_live_… client key), env (default production), ck (context key), v (version).

Terminal window
curl "https://statskit.ai/api/v1/client-config?key=csk_live_...&env=production&ck=user_123&v=42"

POST /client-config

Same output, but the full context is sent in the body (uncacheable). Use when the context has attributes beyond a single key.

Terminal window
curl -X POST https://statskit.ai/api/v1/client-config \
-H "Authorization: Bearer csk_live_..." \
-H "Content-Type: application/json" \
-d '{ "env": "production", "context": { "key": "user_123", "attributes": { "plan": "pro" } } }'

GET /config

Returns the full compiled config for an environment, including targeting rules and segments, for local evaluation on the server. Supports ETag for conditional requests. Takes ssk_ or vsk_.

Terminal window
curl "https://statskit.ai/api/v1/config?env=production" \
-H "Authorization: Bearer ssk_live_..."

GET /config/version

A cheap check for whether the config changed, without shipping the full payload. No key in the URL.

Terminal window
curl "https://statskit.ai/api/v1/config/version?env=production" \
-H "Authorization: Bearer ssk_live_..."

GET /config/stream

Server-Sent Events stream of version changes, so a long-running server can hot-swap config the moment you publish.

Terminal window
curl -N "https://statskit.ai/api/v1/config/stream?env=production" \
-H "Authorization: Bearer ssk_live_..."

POST /evaluate

Evaluate flags on the server for a supplied context and get back the resolved values. Pass ?withExposure=true to record an exposure at the same time. Takes ssk_ or vsk_.

Terminal window
curl -X POST "https://statskit.ai/api/v1/evaluate?withExposure=true" \
-H "Authorization: Bearer ssk_live_..." \
-H "Content-Type: application/json" \
-d '{ "env": "production", "context": { "key": "user_123", "attributes": { "plan": "pro" } } }'

POST /exposures

Record that a context was exposed to a flag/variation, so experiment analytics can attribute conversions. Takes the client key csk_live_….

Terminal window
curl -X POST https://statskit.ai/api/v1/exposures \
-H "Authorization: Bearer csk_live_..." \
-H "Content-Type: application/json" \
-d '{ "flag": "new_dashboard", "variation": 1, "context": { "key": "user_123" } }'
Publish dashboard / API
KV config compiled payload
SDK version poll / SSE
client-config pre-evaluated
Exposures recorded back
Config delivery and the exposure round-trip.