Features flags API
All methods require administrator authorization.
Notice that currently the API only supports boolean and percentage-of-time gate values.
List all features
Get a list of all persisted features, with its gate values.
GET /features
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/features
Example response:
[
{
"name": "experimental_feature",
"state": "off",
"gates": [
{
"key": "boolean",
"value": false
}
]
},
{
"name": "new_library",
"state": "on",
"gates": [
{
"key": "boolean",
"value": true
}
]
}
]
Set or create a feature
Set a feature’s gate value. If a feature with the given name doesn’t exist yet it will be created. The value can be a boolean, or an integer to indicate percentage of time.
POST /features/:name
Attribute | Type | Required | Description |
---|---|---|---|
name
| string | yes | Name of the feature to create or update |
value
| integer/string | yes |
true or false to enable/disable, or an integer for percentage of time
|
feature_group
| string | no | A Feature group name |
user
| string | no | A GitLab username |
group
| string | no | A GitLab group’s path, for example gitlab-org
|
project
| string | no | A projects path, for example gitlab-org/gitlab-foss
|
Note that you can enable or disable a feature for a feature_group
, a user
,
a group
, and a project
in a single API call.
curl --data "value=30" --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/features/new_library
Example response:
{
"name": "new_library",
"state": "conditional",
"gates": [
{
"key": "boolean",
"value": false
},
{
"key": "percentage_of_time",
"value": 30
}
]
}
Delete a feature
Removes a feature gate. Response is equal when the gate exists, or doesn’t.
DELETE /features/:name
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc