debian-mirror-gitlab/doc/api/feature_flag_user_lists.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

190 lines
6.7 KiB
Markdown
Raw Normal View History

2020-06-23 00:09:42 +05:30
---
stage: Release
2021-02-22 17:27:13 +05:30
group: Release
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-06-23 00:09:42 +05:30
---
2021-03-11 19:13:27 +05:30
# Feature flag user lists API **(FREE)**
2020-05-24 23:13:21 +05:30
2021-01-03 14:25:43 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/205409) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.10.
2021-03-11 19:13:27 +05:30
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212318) to GitLab Free in 13.5.
2020-05-24 23:13:21 +05:30
API for accessing GitLab Feature Flag User Lists.
Users with Developer or higher [permissions](../user/permissions.md) can access the Feature Flag User Lists API.
2021-02-22 17:27:13 +05:30
NOTE:
2020-05-24 23:13:21 +05:30
`GET` requests return twenty results at a time because the API results
2021-09-30 23:02:18 +05:30
are [paginated](index.md#pagination). You can change this value.
2020-05-24 23:13:21 +05:30
## List all feature flag user lists for a project
Gets all feature flag user lists for the requested project.
```plaintext
GET /projects/:id/feature_flags_user_lists
```
2021-01-29 00:20:46 +05:30
| Attribute | Type | Required | Description |
| --------- | -------------- | -------- | -------------------------------------------------------------------------------- |
2021-09-30 23:02:18 +05:30
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding). |
2021-01-29 00:20:46 +05:30
| `search` | string | no | Return user lists matching the search criteria. |
2020-05-24 23:13:21 +05:30
```shell
2020-06-23 00:09:42 +05:30
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists"
2020-05-24 23:13:21 +05:30
```
Example response:
```json
[
{
"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.
```plaintext
POST /projects/:id/feature_flags_user_lists
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------|
2021-09-30 23:02:18 +05:30
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding). |
2020-05-24 23:13:21 +05:30
| `name` | string | yes | The name of the feature flag. |
2022-01-26 12:08:38 +05:30
| `user_xids` | string | yes | A comma-separated list of user IDs. |
2020-05-24 23:13:21 +05:30
```shell
2020-06-23 00:09:42 +05:30
curl "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists" \
2020-05-24 23:13:21 +05:30
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--data @- << EOF
{
"name": "my_user_list",
"user_xids": "user1,user2,user3"
}
EOF
```
Example response:
```json
{
"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.
```plaintext
GET /projects/:id/feature_flags_user_lists/:iid
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------|
2021-09-30 23:02:18 +05:30
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding). |
2020-05-24 23:13:21 +05:30
| `iid` | integer/string | yes | The internal ID of the project's feature flag user list. |
```shell
2020-06-23 00:09:42 +05:30
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"
2020-05-24 23:13:21 +05:30
```
Example response:
```json
{
"name": "my_user_list",
"user_xids": "123,456",
"id": 1,
"iid": 1,
"project_id": 1,
"created_at": "2020-02-04T08:13:10.507Z",
2021-06-08 01:23:25 +05:30
"updated_at": "2020-02-04T08:13:10.507Z"
2020-05-24 23:13:21 +05:30
}
```
## Update a feature flag user list
Updates a feature flag user list.
```plaintext
PUT /projects/:id/feature_flags_user_lists/:iid
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------|
2021-09-30 23:02:18 +05:30
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding). |
2020-05-24 23:13:21 +05:30
| `iid` | integer/string | yes | The internal ID of the project's feature flag user list. |
| `name` | string | no | The name of the feature flag. |
2022-01-26 12:08:38 +05:30
| `user_xids` | string | no | A comma-separated list of user IDs. |
2020-05-24 23:13:21 +05:30
```shell
2020-06-23 00:09:42 +05:30
curl "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1" \
2020-05-24 23:13:21 +05:30
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--request PUT \
--data @- << EOF
{
"user_xids": "user2,user3,user4"
}
EOF
```
Example response:
```json
{
"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.
```plaintext
DELETE /projects/:id/feature_flags_user_lists/:iid
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------|
2021-09-30 23:02:18 +05:30
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding). |
2020-05-24 23:13:21 +05:30
| `iid` | integer/string | yes | The internal ID of the project's feature flag user list |
```shell
2020-06-23 00:09:42 +05:30
curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE "https://gitlab.example.com/api/v4/projects/1/feature_flags_user_lists/1"
2020-05-24 23:13:21 +05:30
```