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

NameTypeDescription
search
Query
StringReturn only namespaces that contain the specified value in their name or path
owned_only
Query
BooleanIf true, returns only namespaces owned by the current user
top_level_only
Query
BooleanIf true, returns only top-level namespaces
Default: false
full_path_search
Query
BooleanIf true, the search parameter is matched against the full path of the namespaces
Default: false
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesNamespace
400Bad Request—
401Unauthorized—

Retrieve namespace details

GET /api/v4/namespaces/{id}

Retrieves a specified namespace.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the namespace

Responses

CodeDescriptionSchema
200OKAPIEntitiesNamespace
400Bad Request—
401Unauthorized—
404Not found—

Verify namespace availability

GET /api/v4/namespaces/{id}/exists

Verifies that a namespace is available for use.

Parameters

NameTypeDescription
id
Path, required
StringPath of the namespace
parent_id
Query
IntegerID of the parent namespace. If omitted, only top-level namespaces are considered

Responses

CodeDescriptionSchema
200OKAPIEntitiesNamespaceExistence
400Bad Request—
401Unauthorized—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesNamespace

PropertyTypeDescription
avatar_urlStringExample: https://example.com/avatar/12345
full_pathStringExample: group/my_project
idInteger (int64)Example: 2
kindStringExample: project
members_count_with_descendantsIntegerExample: 5
nameStringExample: project
parent_idInteger (int64)Example: 1
pathStringExample: my_project
projects_countIntegerExample: 123
root_repository_sizeIntegerExample: 123
web_urlStringExample: https://example.com/group/my_project

APIEntitiesNamespaceExistence

PropertyTypeDescription
existsBoolean—
suggestsArray of stringsExample: ["my-group1"]