Dashboard
Segments

List segments

GET
/api/v1/segments

Returns every segment in the workspace. Each segment includes its member count but not its member keys. Use the list segment members endpoint to read the members.

Requires a management key.

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
[index: integer]?

A reusable audience that targeting rules can reference. A subject is in the segment if it matches any rule or its key is in the member list. Segments belong to the workspace and apply in every environment.

Example Request
curl -X GET 'https://api.toggld.io/api/v1/segments'
Example Response
[  {    "key": "beta-testers",    "name": "Beta testers",    "keyAttribute": "targetingKey",    "rules": [      {        "id": "staff",        "conditions": [          {            "attribute": "email",            "operator": "endsWith",            "value": "@example.com"          }        ]      }    ],    "listMode": "inline",    "memberCount": 2,    "version": 4,    "usedBy": [      "new-checkout"    ],    "createdAt": "2026-05-01T12:00:00.000Z",    "updatedAt": "2026-05-03T08:15:00.000Z"  }]