Retrieve a flag snapshot
Returns every flag in the credential's environment with its targeting rules, and the segments those rules use. SDKs that evaluate locally poll this endpoint. Compare version with the version you have to tell whether anything changed.
Accepts an evaluation key or a management key. Public tokens get 403, because targeting rules must not reach browsers.
bearerAuthorizationBearer <token>Send a credential in the Authorization header: Authorization: Bearer <token>.
Each credential belongs to one environment of one workspace, so the API never takes a workspace or environment in the URL.
- Management key (
ffk_…, secret): manages flags, segments, environments, and API keys, and reads the audit log and analytics. It can also do everything an evaluation key can. - Evaluation key (
ffk_…, secret): for server SDKs. It evaluates flags, reads flag definitions for local evaluation, and sends telemetry. - Public token (
ffp_…, not secret): for browser and mobile apps. It evaluates flags through OFREP and sends telemetry. It cannot read flag definitions.
Keep secret keys on your server. A 401 response means the credential is missing or not valid. A 403 response means the credential is valid but its role cannot perform the operation.
OK
application/json- response
A versioned snapshot of every flag definition in one environment, for SDKs that evaluate flags locally.
version*stringAn opaque version of the snapshot. It changes whenever a flag or segment changes. Compare it for equality only.
flags*array<>Every flag in the environment, ready for local evaluation.
segments?array<>The segments that the flags' targeting rules use.
curl -X GET 'https://api.toggld.io/sync/v1/flags'{ "version": "v_2d7f1a4c-9e3b-4c8a-b5f0-1a6d3e9c2b7f", "flags": [ { "key": "new-checkout", "type": "boolean", "enabled": true, "variants": { "on": true, "off": false }, "defaultVariant": "off", "targeting": [ { "id": "beta-users", "conditions": [ { "attribute": "plan", "operator": "eq", "value": "beta" } ], "serve": { "type": "variant", "variant": "on" } } ], "metadata": {}, "createdAt": "2026-05-01T12:00:00.000Z", "updatedAt": "2026-05-02T09:30:00.000Z" } ], "segments": []}Evaluate all flags POST
Evaluates every flag in the credential's environment for the evaluation context in the request body. If one flag fails to evaluate, its result has an `errorCode` instead of a value, and the request still succeeds. Accepts an evaluation key, a management key, or a public token. Returns `400` with `PARSE_ERROR` if the request body is not valid JSON, and `400` with `INVALID_CONTEXT` if it is JSON but not a valid evaluation request.
Report evaluation counts POST
Records a batch of evaluation counts for the credential's environment. Returns `204` with no body. The server counts each batch once. If it already received a batch with the same `sdkInstanceId` and `windowId`, it ignores the new one, so you can safely retry. It drops counts that are older than its retention period or too far in the future. Accepts an evaluation key, a management key, or a public token.