Feature flag user lists API
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Use this API to interact with GitLab feature flags for user lists.
Prerequisites:
- You must have at least the Developer role.
To interact with feature flags for all users, see the Feature flag API.
List all feature flag user lists for a project
Gets all feature flag user lists for the requested project.
GET /projects/:id/feature_flags_user_listsUse the page and per_page pagination parameters to
control the pagination of results.
| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
search | string | no | Return user lists matching the search criteria. |
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists"Example response:
[
{
"name": "user_list",
"user_xids": "user1,user2",
"id": 1,
"iid": 1,
"project_id": 1,
"created_at": "2020-02-04T08:13:51.423Z",
"updated_at": "2020-02-04T08:13:51.423Z"
},
{
"name": "test_users",
"user_xids": "user3,user4,user5",
"id": 2,
"iid": 2,
"project_id": 1,
"created_at": "2020-02-04T08:13:10.507Z",
"updated_at": "2020-02-04T08:13:10.507Z"
}
]Create a feature flag user list
Creates a feature flag user list.
POST /projects/:id/feature_flags_user_lists| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
name | string | yes | The name of the list. |
user_xids | string | yes | A comma-separated list of external user IDs. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists" \
--data @- << EOF
{
"name": "my_user_list",
"user_xids": "user1,user2,user3"
}
EOFExample response:
{
"name": "my_user_list",
"user_xids": "user1,user2,user3",
"id": 1,
"iid": 1,
"project_id": 1,
"created_at": "2020-02-04T08:32:27.288Z",
"updated_at": "2020-02-04T08:32:27.288Z"
}Get a feature flag user list
Gets a feature flag user list.
GET /projects/:id/feature_flags_user_lists/:iidUse the page and per_page pagination parameters to
control the pagination of results.
| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
iid | integer or string | yes | The internal ID of the project’s feature flag user list. |
curl --header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"Example response:
{
"name": "my_user_list",
"user_xids": "123,456",
"id": 1,
"iid": 1,
"project_id": 1,
"created_at": "2020-02-04T08:13:10.507Z",
"updated_at": "2020-02-04T08:13:10.507Z"
}Update a feature flag user list
Updates a feature flag user list.
PUT /projects/:id/feature_flags_user_lists/:iid| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
iid | integer or string | yes | The internal ID of the project’s feature flag user list. |
name | string | no | The name of the list. |
user_xids | string | no | A comma-separated list of external user IDs. |
curl --request PUT \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1" \
--data @- << EOF
{
"user_xids": "user2,user3,user4"
}
EOFExample response:
{
"name": "my_user_list",
"user_xids": "user2,user3,user4",
"id": 1,
"iid": 1,
"project_id": 1,
"created_at": "2020-02-04T08:32:27.288Z",
"updated_at": "2020-02-05T09:33:17.179Z"
}Delete feature flag user list
Deletes a feature flag user list.
DELETE /projects/:id/feature_flags_user_lists/:iid| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer or string | yes | The ID or URL-encoded path of the project. |
iid | integer or string | yes | The internal ID of the project’s feature flag user list |
curl --request DELETE \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"