features

Create or update a feature flag

Creates or updates a feature flag value. If a feature with the given name doesn't exist yet, the operation creates one. The value can be a boolean or an integer to indicate percentage of time.

post/api/v4/features/{name}

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

namestring required

The name of the feature flag

Request body

valuestring required

true or false to enable/disable, or an integer for percentage of time

keystring

percentage_of_actors or percentage_of_time (default)

feature_groupstring

A Feature group name

userstring

A GitLab username or comma-separated multiple usernames

groupstring

A GitLab group's path, for example gitlab-org, or comma-separated multiple group paths

namespacestring

A GitLab group or user namespace's path, for example john-doe, or comma-separated multiple namespace paths. Introduced in GitLab 15.0.

projectstring

A projects path, for example gitlab-org/gitlab-foss, or comma-separated multiple project paths

organizationstring

An organization ID or path, for example 1 or default, or comma-separated multiple organization IDs or paths

repositorystring

A repository path, for example gitlab-org/gitlab-test.git, gitlab-org/gitlab-test.wiki.git, snippets/21.git, to name a few. Use comma to separate multiple repository paths

runnerstring

A runner ID, or comma-separated list of runner IDs

endpointstring

A caller_id identifying a code path, for example GET /api/v4/projects/:id or ProjectsController#show. Use comma to separate multiple endpoint paths

forceboolean

Skip feature flag validation checks, such as a YAML definition

Response

Create or update a feature flag

namestring required
statestring required

Example response

{
  "name": "experimental_feature",
  "state": "off",
  "gates": {
    "key": "percentage_of_actors",
    "value": 34
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.