Use this API to interact with namespaces, a special resource category used to organize users and groups. For more information, see namespaces.
This API uses pagination to filter results.
List all namespaces
GET /api/v4/namespaces
Lists all namespaces available to the current user. If the user is an administrator, this endpoint returns all namespaces in the instance. The response can include additional attributes for group owners or on GitLab.com. The shared_runners_minutes_limit, extra_shared_runners_minutes_limit, additional_purchased_storage_size, and additional_purchased_storage_ends_on attributes are returned only to administrators on GitLab.com.
Parameters
| Name | Type | Description |
|---|---|---|
searchQuery | String | Return only namespaces that contain the specified value in their name or path |
owned_Query | Boolean | If true, |
top_Query | Boolean | If true,Default: false |
full_Query | Boolean | If true,search parameter is matched against the full path of the namespacesDefault: false |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
Retrieve namespace details
GET /api/v4/namespaces/{id}
Retrieves a specified namespace.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not found | — |
Verify namespace availability
GET /api/v4/namespaces/{id}/exists
Verifies that a namespace is available for use. If the namespace exists, the response suggests an alternate name in suggests.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | Path of the namespace |
parent_Query | Integer | ID of the parent namespace. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesNamespace
| Property | Type | Description |
|---|---|---|
avatar_ | String | URL of the namespace avatar.null if no avatar is setExample: https: |
full_ | String | Full path of the namespace, Example: group/ |
id | Integer (int64) | ID of the namespace Example: 2 |
kind | String | Type of the namespace:user,group,projectExample: project |
members_ | Integer | Number of members of the group and its subgroups. Example: 5 |
name | String | Name of the namespace Example: project |
parent_ | Integer (int64) | ID of the parent namespace.null for top-Example: 1 |
path | String | Path of the namespace Example: my_ |
projects_ | Integer | Number of projects in the group and its subgroups. Example: 123 |
root_ | Integer | Total size of all repositories in the namespace, Example: 123 |
web_ | String | Web URL of the namespace. Example: https: |
APIEntitiesNamespaceExistence
| Property | Type | Description |
|---|---|---|
exists | Boolean | — |
suggests | Array of strings | Example:["my- |