---
title: "Update a flag"
method: PATCH
path: "/v1/projects/{projectIdOrName}/feature-flags/flags/{flagIdOrSlug}"
tags: ["feature-flags"]
---

# Update a flag

`PATCH /v1/projects/{projectIdOrName}/feature-flags/flags/{flagIdOrSlug}`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v1/projects/{projectIdOrName}/feature-flags/flags/{flagIdOrSlug}`
- Auth: HTTP bearer

Update an existing feature flag. This endpoint supports partial updates, allowing you to modify specific properties like variants, environments, or state without providing the full flag configuration.

## 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
- `slug` string

## Request body

- object
  - `createdBy` string: The user who created this patch
  - `message` string: Additional message for this version
  - `variants` object[]: The variants of the flag
    - `id` string, required: The id of the variant
    - `label` string: A label for the variant
    - `description` string: A description of the variant
    - `value` union, required
      - string
      - number
      - boolean
      - object
      - unknown[]
        - unknown
      - string
  - `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
  - `description` string: A description of the flag
  - `state` 'active' | 'archived'
  - `maintainerIds` string[]: The user ids of the maintainers of the flag
  - `permanent` boolean: Whether this flag is marked as permanent, indicating it should not be removed
  - `tags` string[]: Tags for categorizing the flag

## Response `200`

- object
  - `createdAt` number, required
  - `createdBy` string, required
  - `description` string
  - `environments` object, required
  - `id` string, required
  - `kind` 'boolean' | 'json' | 'number' | 'string', required
  - `maintainerIds` string[]
  - `ownerId` string, required
  - `permanent` false | true
  - `projectId` string, required
  - `revision` number, required
  - `seed` number, required
  - `seenInProduction` false | true
  - `slug` string, required
  - `state` 'active' | 'archived', required
  - `tags` string[]
  - `typeName` 'flag', required
  - `updatedAt` number, required
  - `updatedBy` string
  - `variants` object[], required
    - `description` string
    - `id` string, required
    - `label` string
    - `value` union, required
      - string
      - number
      - object
      - unknown[]
        - unknown
      - false | true

## Other responses

- `304`
- `400`: One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401`: The request is not authorized.
- `402`: The account is missing a payment so payment method must be updated
- `403`: You do not have permission to access this resource.
- `404`
- `409`
- `410`

## Changes

- **2026-10-15** `8939e3983223`: 1 info
  - added the optional property `seenInProduction` to the response with the `200` status
- **2026-10-08** `f5c63f03ee0c`: 1 breaking, 20 info
  - the response's body type changed from no type to `object` for status `200`
  - removed `#/components/schemas/Flag, subschema #1` from the response body `oneOf` list for the response status `200`
  - added the optional property `description` to the response with the `200` status
  - added the optional property `maintainerIds` to the response with the `200` status
  - …17 more
- **2026-09-30** `099fbe1f521c`: 6 info
  - added the new optional request property `environments/additionalProperties/fallthrough/anyOf[subschema #3]/finalPromille`
  - added the new optional request property `environments/additionalProperties/rules/items/outcome/anyOf[subschema #3]/finalPromille`
  - added the optional property `oneOf[#/components/schemas/Flag]/environments/additionalProperties/fallthrough/oneOf[subschema #3]/finalPromille` to the response with the `200` status
  - added the optional property `oneOf[#/components/schemas/Flag]/environments/additionalProperties/rules/items/outcome/oneOf[subschema #3]/finalPromille` to the response with the `200` status
  - …2 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v1/projects/:projectIdOrName/feature-flags/flags/:flagIdOrSlug/patch.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
