List segments
GET
https://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/segmentsList all feature flag segments for a project.
https://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/segments
const response = await fetch('https://api.vercel.com/v1/projects/projectIdOrName/feature-flags/segments?withMetadata=true&teamId=string&slug=string', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', },});
const data = await response.json();console.log(data);Response
{ "data": [ { "createdAt": "123", "createdBy": "string", "data": { "exclude": "value", "include": "value", "rules": [ { "conditions": [ { "cmp": "!contains", "cmpOptions": { "ignoreCase": "false" }, "lhs": { "type": "segment" }, "rhs": "string" } ], "id": "icfg_1234567890", "outcome": { "type": "all" } } ] }, "description": "string", "hint": "string", "id": "icfg_1234567890", "label": "string", "projectId": "example_id", "slug": "string", "typeName": "segment", "updatedAt": "123", "usedByFlags": [], "usedBySegments": [], "metadata": { "creator": { "id": "icfg_1234567890", "name": "Example Name" } } } ]}AuthorizationbearerToken
Default authentication mechanism