Skip to content

Update a feature flag

PUT
/api/v4/projects/{id}/feature_flags/{feature_flag_name}

Updates a specified feature flag.

id
required
One of:
string

The ID or URL-encoded path of the project

feature_flag_name
required
string

The name of the feature flag

Media type application/json
object
name

The new name of the feature flag. Supported in GitLab 13.3 and later

string
nullable
description

The description of the feature flag

string
nullable
active

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

boolean
nullable
strategies

Array of feature flag strategies

Array<object>
nullable
object
id

The feature flag strategy ID

integer
nullable
name

The strategy name

string
nullable
parameters

The strategy parameters as a JSON-formatted string e.g. {"userIds":"user1"}

object
user_list_id

The ID of the feature flag user list

integer
nullable
_destroy

Delete the strategy when true

boolean
nullable
scopes

Array of scopes for the strategy

Array<object>
nullable
object
id

The scope id

integer
nullable
environment_scope

The environment scope of the scope

string
nullable
_destroy

Delete the scope when true

boolean
nullable
Example generated
{
"name": "example",
"description": "example",
"active": true,
"strategies": [
{
"id": 1,
"name": "example",
"parameters": {},
"user_list_id": 1,
"_destroy": true,
"scopes": [
{
"id": 1,
"environment_scope": "example",
"_destroy": true
}
]
}
]
}

OK

Media type application/json
object
name
string
description
string
active
boolean
version
string
created_at
string format: date-time
updated_at
string format: date-time
scopes
array
strategies
object
id
integer format: int64
name
string
parameters
string
scopes
object
id
integer format: int64
environment_scope
string
user_list
object
id
integer format: int64
iid
integer
name
string
user_xids
string
Example
{
"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"
}
}
}

Bad Request

Unauthorized

Forbidden

Not found

Unprocessable entity