Skip to content

Commit df4d676

Browse files
committed
Merge branch 'doc_refactor_namespaces_api' into 'master'
Refactor namespaces API documentation See merge request !2472
2 parents 28c14ce + 2b3e64a commit df4d676

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

doc/api/namespaces.md

+33-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
# Namespaces
22

3+
Usernames and groupnames fall under a special category called namespaces.
4+
5+
For users and groups supported API calls see the [users](users.md) and
6+
[groups](groups.md) documentation respectively.
7+
8+
[Pagination](README.md#pagination) is used.
9+
310
## List namespaces
411

5-
Get a list of namespaces. (As user: my namespaces, as admin: all namespaces)
12+
Get a list of the namespaces of the authenticated user. If the user is an
13+
administrator, a list of all namespaces in the GitLab instance is shown.
614

715
```
816
GET /namespaces
917
```
1018

19+
Example request:
20+
21+
```bash
22+
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/namespaces
23+
```
24+
25+
Example response:
26+
1127
```json
1228
[
1329
{
@@ -23,22 +39,32 @@ GET /namespaces
2339
]
2440
```
2541

26-
You can search for namespaces by name or path, see below.
27-
2842
## Search for namespace
2943

30-
Get all namespaces that match your string in their name or path.
44+
Get all namespaces that match a string in their name or path.
3145

3246
```
3347
GET /namespaces?search=foobar
3448
```
3549

50+
| Attribute | Type | Required | Description |
51+
| --------- | ---- | -------- | ----------- |
52+
| `search` | string | no | Returns a list of namespaces the user is authorized to see based on the search criteria |
53+
54+
Example request:
55+
56+
```bash
57+
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/namespaces?search=twitter
58+
```
59+
60+
Example response:
61+
3662
```json
3763
[
3864
{
39-
"id": 1,
40-
"path": "user1",
41-
"kind": "user"
65+
"id": 4,
66+
"path": "twitter",
67+
"kind": "group"
4268
}
4369
]
4470
```

0 commit comments

Comments
 (0)