Skip to content

Commit ddc8b91

Browse files
committed
Refactor namespaces API documentation [ci skip]
1 parent 835f196 commit ddc8b91

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

doc/api/namespaces.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# Namespaces
22

3+
Namespaces account for usernames and groupnames.
4+
5+
[Pagination](README.md#pagination) is used.
6+
37
## List namespaces
48

5-
Get a list of namespaces. (As user: my namespaces, as admin: all namespaces)
9+
Get a list of namespaces. As a user, your namespaces are listed whereas if you
10+
are an administrator you get a list of all namespaces in the GitLab instance.
611

712
```
813
GET /namespaces
914
```
1015

16+
```bash
17+
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/namespaces
18+
```
19+
1120
```json
1221
[
1322
{
@@ -23,22 +32,28 @@ GET /namespaces
2332
]
2433
```
2534

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

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

3239
```
3340
GET /namespaces?search=foobar
3441
```
3542

43+
| Attribute | Type | Required | Description |
44+
| --------- | ---- | -------- | ----------- |
45+
| `search` | string | no | Returns a list of namespaces the user is authorized to see based on the search criteria |
46+
47+
```bash
48+
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/namespaces?search=twitter
49+
```
50+
3651
```json
3752
[
3853
{
39-
"id": 1,
40-
"path": "user1",
41-
"kind": "user"
54+
"id": 4,
55+
"path": "twitter",
56+
"kind": "group"
4257
}
4358
]
4459
```

0 commit comments

Comments
 (0)