GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Go to GitLab Docs homepage
  • What's new?
  • Get free trial
  • Use GitLab
  • GitLab Duo
  • GitLab Orbit
  • Extend
  • Install
  • Administer
  • Subscribe
  • Contribute
  • Solutions
  • Getting started
  • Tutorials

This view

  • Original page
  • New address

GeezerVison is showing docs.gitlab.com — Namespaces API | GitLab Docs

 / 

Namespaces API

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
  • Visibility of billing-related fields changed in GitLab 18.3 with a feature flag named restrict_namespace_api_billing_fields. Disabled by default.
  • Visibility of billing-related fields generally available in GitLab 18.9. Feature flag restrict_namespace_api_billing_fields removed.
  • billable_members_count for subgroups changed to null in GitLab 19.7 with a feature flag named skip_subgroup_billable_members_count. Disabled by default.

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

  • ci_minutes_usage introduced in GitLab 19.4.

Lists all namespaces available to the current user. If the user is an administrator, this endpoint returns all namespaces in the instance.

GET /namespaces
AttributeTypeRequiredDescription
searchstringnoReturns only namespaces that contain the specified value in their name or path.
owned_onlybooleannoIf true, only returns namespaces by the current user.
top_level_onlybooleannoIf true, only returns top-level namespaces.
full_path_searchbooleannoIf true, the search parameter is matched against the full path of the namespaces.

If successful, returns 200 OK and the following response attributes:

AttributeTypeDescription
idintegerID of the namespace.
namestringName of the namespace.
pathstringPath segment of the namespace.
kindstringNamespace type: user or group.
full_pathstringFull path of the namespace, including parent paths for subgroups.
parent_idintegerID of the parent namespace. null for top-level namespaces.
avatar_urlstringURL of the namespace avatar. null if not set.
web_urlstringURL of the namespace on GitLab.
billable_members_countintegerNumber of billable members in the namespace. null if the user does not have permission to view billing for the namespace. If the skip_subgroup_billable_members_count feature flag is enabled, also null for subgroups.
planstringSubscription plan of the namespace (for example, free, ultimate).
end_datedateEnd date of the current subscription. null if not applicable.
trial_ends_ondateDate the trial ends. null if not on a trial.
trialbooleanWhether the namespace is on a trial plan.
root_repository_sizeintegerTotal size of all repositories in the namespace, in bytes.
projects_countintegerNumber of projects in the namespace.
members_count_with_descendantsintegerTotal number of members including those in subgroups. Only returned for group namespaces.
max_seats_usedintegerMaximum number of seats used during the current subscription period. Only returned for Group owners or on GitLab.com.
max_seats_used_changed_atdatetimeTimestamp of when max_seats_used last changed. Only returned for Group owners or on GitLab.com.
seats_in_useintegerNumber of seats currently in use. Only returned for Group owners or on GitLab.com.
ci_minutes_usageobjectCompute minutes usage breakdown. On GitLab.com, reflects the compute minutes quota system applied to all namespaces. On GitLab Self-Managed and GitLab Dedicated, returned only when compute quotas are configured on a namespace. Only returned for top-level groups when the user has the Owner role, is an auditor user, or is an administrator.
ci_minutes_usage.total_minutes_usedintegerTotal compute minutes used in the current billing period.
ci_minutes_usage.monthly_minutes_usedintegerCompute minutes used from the monthly quota.
ci_minutes_usage.purchased_minutes_usedintegerCompute minutes used from additional purchased allocations.
shared_runners_minutes_limitintegerMonthly compute minutes quota allocated to the namespace. On GitLab.com only, for instance administrators.
extra_shared_runners_minutes_limitintegerAdditional compute minutes added on top of the monthly quota. Reflects purchased minute packs. On GitLab.com only, for instance administrators.

Example request:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/namespaces"

Example response:

json
[
  {
    "id": 1,
    "name": "user1",
    "path": "user1",
    "kind": "user",
    "full_path": "user1",
    "parent_id": null,
    "avatar_url": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
    "web_url": "https://gitlab.example.com/user1",
    "billable_members_count": 1,
    "plan": "ultimate",
    "end_date": null,
    "trial_ends_on": null,
    "trial": false,
    "root_repository_size": 100,
    "projects_count": 3
  },
  {
    "id": 2,
    "name": "group1",
    "path": "group1",
    "kind": "group",
    "full_path": "group1",
    "parent_id": null,
    "avatar_url": null,
    "web_url": "https://gitlab.example.com/groups/group1",
    "members_count_with_descendants": 2,
    "billable_members_count": 2,
    "plan": "ultimate",
    "end_date": null,
    "trial_ends_on": null,
    "trial": false,
    "root_repository_size": 100,
    "projects_count": 3
  },
  {
    "id": 3,
    "name": "bar",
    "path": "bar",
    "kind": "group",
    "full_path": "foo/bar",
    "parent_id": 9,
    "avatar_url": null,
    "web_url": "https://gitlab.example.com/groups/foo/bar",
    "members_count_with_descendants": 5,
    "billable_members_count": 5,
    "end_date": null,
    "trial_ends_on": null,
    "trial": false,
    "root_repository_size": 100,
    "projects_count": 3
  }
]

The following additional attributes might be returned for Group owners or on GitLab.com. The four compute minute and purchased storage attributes (shared_runners_minutes_limit, extra_shared_runners_minutes_limit, additional_purchased_storage_size, additional_purchased_storage_ends_on) are returned only to administrators on GitLab.com:

json
[
  {
    ...
    "max_seats_used": 3,
    "max_seats_used_changed_at":"2025-05-15T12:00:02.000Z",
    "seats_in_use": 2,
    "projects_count": 1,
    "root_repository_size":0,
    "members_count_with_descendants":26,
    "plan": "free",
    "shared_runners_minutes_limit": 133,
    "extra_shared_runners_minutes_limit": 50,
    "additional_purchased_storage_size": 1000,
    "additional_purchased_storage_ends_on": "2022-06-18",
    ...
  }
]

Retrieve namespace details

  • ci_minutes_usage introduced in GitLab 19.4.

Retrieves details for a specified namespace.

GET /namespaces/:id
AttributeTypeRequiredDescription
idinteger or stringyesID or URL-encoded path of the namespace.

If successful, returns 200 OK and the following response attributes:

AttributeTypeDescription
idintegerID of the namespace.
namestringName of the namespace.
pathstringPath segment of the namespace.
kindstringNamespace type: user or group.
full_pathstringFull path of the namespace, including parent paths for subgroups.
parent_idintegerID of the parent namespace. null for top-level namespaces.
avatar_urlstringURL of the namespace avatar. null if not set.
web_urlstringURL of the namespace on GitLab.
billable_members_countintegerNumber of billable members in the namespace. null if the user does not have permission to view billing for the namespace. If the skip_subgroup_billable_members_count feature flag is enabled, also null for subgroups.
planstringSubscription plan of the namespace (for example, free, ultimate).
end_datedateEnd date of the current subscription. null if not applicable.
trial_ends_ondateDate the trial ends. null if not on a trial.
trialbooleanWhether the namespace is on a trial plan.
root_repository_sizeintegerTotal size of all repositories in the namespace, in bytes.
projects_countintegerNumber of projects in the namespace.
members_count_with_descendantsintegerTotal number of members including those in subgroups. Only returned for group namespaces.
max_seats_usedintegerMaximum number of seats used during the current subscription period. Only returned for Group owners or on GitLab.com.
max_seats_used_changed_atdatetimeTimestamp of when max_seats_used last changed. Only returned for Group owners or on GitLab.com.
seats_in_useintegerNumber of seats currently in use. Only returned for Group owners or on GitLab.com.
ci_minutes_usageobjectCompute minutes usage breakdown. On GitLab.com, reflects the compute minutes quota system applied to all namespaces. On GitLab Self-Managed and GitLab Dedicated, returned only when compute quotas are configured on a namespace. Only returned for top-level groups when the user has the Owner role, is an auditor user, or is an administrator.
ci_minutes_usage.total_minutes_usedintegerTotal compute minutes used in the current billing period.
ci_minutes_usage.monthly_minutes_usedintegerCompute minutes used from the monthly quota.
ci_minutes_usage.purchased_minutes_usedintegerCompute minutes used from additional purchased allocations.
shared_runners_minutes_limitintegerMonthly compute minutes quota allocated to the namespace. On GitLab.com only, for instance administrators.
extra_shared_runners_minutes_limitintegerAdditional compute minutes added on top of the monthly quota. Reflects purchased minute packs. On GitLab.com only, for instance administrators.

Example request:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/namespaces/2"

Example response:

json
{
  "id": 2,
  "name": "group1",
  "path": "group1",
  "kind": "group",
  "full_path": "group1",
  "parent_id": null,
  "avatar_url": null,
  "web_url": "https://gitlab.example.com/groups/group1",
  "members_count_with_descendants": 2,
  "billable_members_count": 2,
  "max_seats_used": 0,
  "seats_in_use": 0,
  "plan": "default",
  "end_date": null,
  "trial_ends_on": null,
  "trial": false,
  "root_repository_size": 100,
  "projects_count": 3,
  "ci_minutes_usage": {
    "total_minutes_used": 450,
    "monthly_minutes_used": 400,
    "purchased_minutes_used": 50
  }
}

Example request:

shell
curl --header "PRIVATE-TOKEN: <your_access_token>" \
    --url "https://gitlab.example.com/api/v4/namespaces/group1"

Example response:

json
{
  "id": 2,
  "name": "group1",
  "path": "group1",
  "kind": "group",
  "full_path": "group1",
  "parent_id": null,
  "avatar_url": null,
  "web_url": "https://gitlab.example.com/groups/group1",
  "members_count_with_descendants": 2,
  "billable_members_count": 2,
  "max_seats_used": 0,
  "seats_in_use": 0,
  "plan": "default",
  "end_date": null,
  "trial_ends_on": null,
  "trial": false,
  "root_repository_size": 100,
  "ci_minutes_usage": {
    "total_minutes_used": 450,
    "monthly_minutes_used": 400,
    "purchased_minutes_used": 50
  }
}

Verify namespace availability

Verifies if a specified namespace exists. If the namespace exists, the endpoint suggests an alternate name.

GET /namespaces/:namespace/exists
AttributeTypeRequiredDescription
namespacestringyesPath of the namespace.
parent_idintegernoID of the parent namespace. If unspecified, only returns top-level namespaces.

Example request:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/namespaces/my-group/exists?parent_id=1"

Example response:

json
{
    "exists": true,
    "suggests": [
        "my-group1"
    ]
}
Was this page helpful?
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.