Dashboard
Definition sync

Retrieve a flag snapshot

GET
/sync/v1/flags

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.

Authorization

bearer
headerAuthorizationBearer <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.

Response Body

OK

application/json
  1. response

A versioned snapshot of every flag definition in one environment, for SDKs that evaluate flags locally.

version*string

An 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.

Example Request
curl -X GET 'https://api.toggld.io/sync/v1/flags'
Example Response
{  "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": []}