feature_flags

Create a feature flag

Creates a feature flag for a specified project.

post/api/v4/projects/{id}/feature_flags

Request

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

Path parameters

idstring required

The ID or URL-encoded path of the project

Request body

namestring required

The name of the feature flag

descriptionstring

The description of the feature flag

activeboolean

The active state of the flag. Defaults to true. Supported in GitLab 13.3 and later

versionstring

The version of the feature flag. Must be new_version_flag. Omit to create a Legacy feature flag.

Response

Create a feature flag

namestring required
descriptionstring required
activeboolean required
versionstring required
created_atstring date-time required
updated_atstring date-time required

Example response

{
  "name": "merge_train",
  "description": "merge train feature flag",
  "version": "new_version_flag",
  "created_at": "2019-11-04T08:13:51.423Z",
  "updated_at": "2019-11-04T08:13:51.423Z",
  "strategies": {
    "id": 1,
    "name": "userWithId",
    "parameters": "{\"userIds\": \"user1\"}",
    "scopes": {
      "id": 1,
      "environment_scope": "production"
    },
    "user_list": {
      "id": 1,
      "iid": 1,
      "name": "user_list",
      "user_xids": "user1,user2"
    }
  }
}

Changes

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