Skip to main content
PATCH
/
v1
/
projects
/
{projectIdOrName}
/
feature-flags
/
flags
/
{flagIdOrSlug}
updateFlag
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.featureFlags.updateFlag({
    projectIdOrName: "<value>",
    flagIdOrSlug: "<value>",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();
{
  "variants": [
    {
      "value": "<string>",
      "id": "<string>",
      "description": "<string>",
      "label": "<string>"
    }
  ],
  "id": "<string>",
  "environments": {},
  "kind": "string",
  "revision": 123,
  "seed": 123,
  "state": "active",
  "slug": "<string>",
  "createdAt": 123,
  "updatedAt": 123,
  "createdBy": "<string>",
  "ownerId": "<string>",
  "projectId": "<string>",
  "typeName": "flag",
  "description": "<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

flagIdOrSlug
string
required

The flag id or name

Query Parameters

ifMatch
string

Etag to match, can be used interchangeably with the if-match header

withMetadata
boolean

Whether to include metadata in the response

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"

Body

application/json
createdBy
string

The user who created this patch

message
string

Additional message for this version

variants
object[]

The variants of the flag

environments
object

The configuration for the flag in different environments

seed
number

A random seed to prevent split points in different flags from having the same targets

Required range: 0 <= x <= 100000
description
string

A description of the flag

state
enum<string>
Available options:
active,
archived

Response

variants
object[]
required
id
string
required
environments
object
required
kind
enum<string>
required
Available options:
string,
number,
boolean
revision
number
required
seed
number
required
state
enum<string>
required
Available options:
active,
archived
slug
string
required
createdAt
number
required
updatedAt
number
required
createdBy
string
required
ownerId
string
required
projectId
string
required
typeName
enum<string>
required
Available options:
flag
description
string
metadata
object