List segments
GET
https://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/segmentsList all feature flag segments for a project.
Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.featureFlags.listFlagSegments({ projectIdOrName: "<value>", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
{ "data": [ { "description": "string", "createdBy": "string", "usedByFlags": [], "usedBySegments": [], "data": { "rules": [ { "id": "icfg_1234567890", "outcome": { "type": "all" }, "conditions": [ { "rhs": "string", "cmpOptions": { "ignoreCase": "false" }, "lhs": { "type": "segment" }, "cmp": "!contains" } ] } ], "include": "value", "exclude": "value" }, "id": "icfg_1234567890", "label": "string", "slug": "string", "createdAt": "123", "updatedAt": "123", "projectId": "example_id", "typeName": "segment", "hint": "string", "metadata": { "creator": { "id": "icfg_1234567890", "name": "Example Name" } } } ]}AuthorizationbearerToken
Default authentication mechanism