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.
Parameters
| Name | Type | Description |
|---|---|---|
searchQuery | String | Returns a list of namespaces the user is authorized to view based on the search criteria |
owned_Query | Boolean | In Git |
top_Query | Boolean | Only include top level namespaces Default: false |
full_Query | Boolean | If true,search parameter is matched against the full path of the namespacesDefault: false |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | 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.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | Namespace’s path |
parent_Query | Integer | The 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 | Example:https: |
full_ | String | Example:group/ |
id | Integer (int64) | Example:2 |
kind | String | Example:project |
members_ | Integer | Example:5 |
name | String | Example:project |
parent_ | Integer (int64) | Example:1 |
path | String | Example:my_ |
projects_ | Integer | Example:123 |
root_ | Integer | Example:123 |
web_ | String | Example:https: |
APIEntitiesNamespaceExistence
| Property | Type | Description |
|---|---|---|
exists | Boolean | — |
suggests | Array of strings | Example:["my- |