Skip to main content
GET
/
v1
/
projects
/
{projectIdOrName}
/
feature-flags
/
segments
listFlagSegments
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();
{
  "data": [
    {
      "id": "<string>",
      "label": "<string>",
      "slug": "<string>",
      "createdAt": 123,
      "updatedAt": 123,
      "projectId": "<string>",
      "typeName": "segment",
      "data": {
        "rules": [
          {
            "id": "<string>",
            "outcome": {
              "type": "all"
            },
            "conditions": [
              {
                "lhs": {
                  "type": "segment"
                },
                "cmp": "eq",
                "rhs": "<string>"
              }
            ]
          }
        ],
        "include": {},
        "exclude": {}
      },
      "hint": "<string>",
      "description": "<string>",
      "createdBy": "<string>",
      "usedByFlags": [
        "<string>"
      ],
      "usedBySegments": [
        "<string>"
      ],
      "metadata": {
        "creator": {
          "id": "<string>",
          "name": "<string>"
        }
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Path Parameters

projectIdOrName
string
required

The project id or name

Query Parameters

withMetadata
boolean
default:false

Whether to include metadata

teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Response

data
object[]
required