summaryrefslogtreecommitdiff
path: root/doc/api/namespaces.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/namespaces.md')
-rw-r--r--doc/api/namespaces.md52
1 files changed, 9 insertions, 43 deletions
diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md
index ac8ea95ef30..03aefaf4380 100644
--- a/doc/api/namespaces.md
+++ b/doc/api/namespaces.md
@@ -6,7 +6,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Namespaces API
-Usernames and group names fall under a special category called namespaces.
+Usernames and group names fall under a special category called
+[namespaces](../user/group/index.md#namespaces).
For users and groups supported API calls see the [users](users.md) and
[groups](groups.md) documentation respectively.
@@ -20,8 +21,15 @@ administrator, a list of all namespaces in the GitLab instance is shown.
```plaintext
GET /namespaces
+GET /namespaces?search=foobar
+GET /namespaces?owned_only=true
```
+| Attribute | Type | Required | Description |
+| ------------ | ------- | -------- | ----------- |
+| `search` | string | no | Returns a list of namespaces the user is authorized to view based on the search criteria |
+| `owned_only` | boolean | no | In GitLab 14.2 and later, returns a list of owned namespaces only |
+
Example request:
```shell
@@ -115,48 +123,6 @@ once a day.
NOTE:
Only group owners are presented with `members_count_with_descendants` and `plan`.
-## Search for namespace
-
-Get all namespaces that match a string in their name or path.
-
-```plaintext
-GET /namespaces?search=foobar
-```
-
-| Attribute | Type | Required | Description |
-| --------- | ------ | -------- | ----------- |
-| `search` | string | no | Returns a list of namespaces the user is authorized to see based on the search criteria |
-
-Example request:
-
-```shell
-curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/namespaces?search=twitter"
-```
-
-Example response:
-
-```json
-[
- {
- "id": 4,
- "name": "twitter",
- "path": "twitter",
- "kind": "group",
- "full_path": "twitter",
- "parent_id": null,
- "avatar_url": null,
- "web_url": "https://gitlab.example.com/groups/twitter",
- "members_count_with_descendants": 2,
- "billable_members_count": 2,
- "max_seats_used": 0,
- "seats_in_use": 0,
- "plan": "default",
- "trial_ends_on": null,
- "trial": false
- }
-]
-```
-
## Get namespace by ID
Get a namespace by ID.