GitLab Namespaces API

Use this API to interact with namespaces, a special resource category used to organize users and groups. For more information, see [namespaces](https://docs.gitlab.com/user/namespace/). This API uses [pagination](https://docs.gitlab.com/api/rest/#pagination) to filter results.

Operations 8

GET /api/v4/namespaces/{id}/gitlab_subscription Retrieve namespace subscription #
PUT /api/v4/namespaces/{id} Update a namespace #
GET /api/v4/namespaces/{id} Retrieve namespace details #
POST /api/v4/namespaces/{id}/storage/limit_exclusion Creates a storage limit exclusion for a Namespace #
DELETE /api/v4/namespaces/{id}/storage/limit_exclusion Removes a storage limit exclusion for a Namespace #
GET /api/v4/namespaces/storage/limit_exclusions Retrieve all limit exclusions #
GET /api/v4/namespaces List all namespaces #
GET /api/v4/namespaces/{id}/exists Verify namespace availability #

Documentation

📖
Documentation
https://docs.gitlab.com/api/openapi/
📖
Documentation
https://docs.gitlab.com/api/issues/
📖
Authentication
https://docs.gitlab.com/api/rest/authentication/
📖
Documentation
https://docs.gitlab.com/api/merge_requests/
📖
Documentation
https://docs.gitlab.com/api/pipelines/
📖
Documentation
https://docs.gitlab.com/api/jobs/
📖
Documentation
https://docs.gitlab.com/api/runners/
📖
Documentation
https://docs.gitlab.com/api/users/
📖
Documentation
https://docs.gitlab.com/api/repositories/
📖
Documentation
https://docs.gitlab.com/api/commits/
📖
Documentation
https://docs.gitlab.com/api/branches/
📖
Documentation
https://docs.gitlab.com/api/tags/
📖
Documentation
https://docs.gitlab.com/api/releases/
📖
Documentation
https://docs.gitlab.com/api/environments/
📖
Documentation
https://docs.gitlab.com/api/deployments/
📖
Documentation
https://docs.gitlab.com/api/pipeline_schedules/
📖
Documentation
https://docs.gitlab.com/api/labels/
📖
Documentation
https://docs.gitlab.com/api/milestones/
📖
Documentation
https://docs.gitlab.com/api/notes/
📖
Documentation
https://docs.gitlab.com/api/snippets/
📖
Documentation
https://docs.gitlab.com/api/packages/
📖
Documentation
https://docs.gitlab.com/api/container_registry/
📖
Documentation
https://docs.gitlab.com/api/vulnerabilities/
📖
Documentation
https://docs.gitlab.com/api/deploy_keys/
📖
Documentation
https://docs.gitlab.com/api/protected_branches/
📖
Documentation
https://docs.gitlab.com/api/wikis/
📖
Documentation
https://docs.gitlab.com/api/events/
📖
Documentation
https://docs.gitlab.com/api/search/
📖
Documentation
https://docs.gitlab.com/api/namespaces/
📖
Documentation
https://docs.gitlab.com/api/groups/
📖
Documentation
https://docs.gitlab.com/api/projects/
📖
Documentation
https://docs.gitlab.com/api/applications/
📖
Documentation
https://docs.gitlab.com/api/avatar/
📖
Documentation
https://docs.gitlab.com/api/broadcast_messages/
📖
Documentation
https://docs.gitlab.com/api/bulk_imports/
📖
Documentation
https://docs.gitlab.com/api/settings/
📖
Documentation
https://docs.gitlab.com/api/metadata/
📖
Documentation
https://docs.gitlab.com/api/version/
📖
Documentation
https://docs.gitlab.com/api/rest/
📖
APIReference
https://docs.gitlab.com/api/api_resources/
📖
RateLimits
https://docs.gitlab.com/security/rate_limits/
📖
Documentation
https://docs.gitlab.com/api/oauth2/
📖
Authentication
https://docs.gitlab.com/integration/oauth_provider/
📖
Documentation
https://docs.gitlab.com/user/project/integrations/webhooks.html
📖
APIReference
https://docs.gitlab.com/api/project_webhooks/

Specifications

Schemas & Data

📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-application-settings-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-node-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-site-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-application-setting-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-post-api-v4-geo-status-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-projects-id-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-cluster-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-batched-background-migration-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-ci-variable-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-dictionary-table-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-plan-limit-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-appearance-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-avatar-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-imports-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-import-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-metadata-schema.json

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gitlab:gitlab-namespaces-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gitlab-namespaces-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab REST Namespaces API
  description: GitLab REST API used to interact with a GitLab installation.
  termsOfService: https://handbook.gitlab.com/handbook/legal/api-terms/
  version: '19.6'
  license:
    name: CC BY-SA 4.0
    url: https://gitlab.com/gitlab-org/gitlab/-/blob/master/LICENSE
    x-gitlab-description: The license applies to the OpenAPI specification document itself. For terms governing use of the GitLab API, see the termsOfService field.
servers:
- url: https://{hostname}
  description: GitLab REST API
  variables:
    hostname:
      default: gitlab.com
      description: Your GitLab instance hostname
security:
- http: []
- oauth2: []
- apiKey: []
tags:
- name: Namespaces
  description: '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.'
  x-displayName: Namespaces
  externalDocs:
    url: https://docs.gitlab.com/api/namespaces/
paths:
  /api/v4/namespaces/{id}/gitlab_subscription:
    get:
      operationId: getApiV4NamespacesIdGitlabSubscription
      summary: Retrieve namespace subscription
      description: Retrieves GitLab subscription details for a specified namespace.
      tags:
      - Namespaces
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesGitlabSubscription'
        '404':
          description: Not Found
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the namespace.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
  /api/v4/namespaces/{id}:
    put:
      operationId: putApiV4NamespacesId
      summary: Update a namespace
      description: Deprecated in 17.8
      tags:
      - Namespaces
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesNamespace'
        '404':
          description: Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the namespace.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/putApiV4NamespacesIdRequest'
    get:
      operationId: getApiV4NamespacesId
      summary: Retrieve namespace details
      description: Retrieves a specified namespace.
      tags:
      - Namespaces
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesNamespace'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the namespace.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
  /api/v4/namespaces/{id}/storage/limit_exclusion:
    post:
      operationId: postApiV4NamespacesIdStorageLimitExclusion
      summary: Creates a storage limit exclusion for a Namespace
      description: Creates a Namespaces::Storage::LimitExclusion
      tags:
      - Namespaces
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesNamespacesStorageLimitExclusion'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the namespace.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4NamespacesIdStorageLimitExclusionRequest'
    delete:
      operationId: deleteApiV4NamespacesIdStorageLimitExclusion
      summary: Removes a storage limit exclusion for a Namespace
      description: Removes a Namespaces::Storage::LimitExclusion
      tags:
      - Namespaces
      responses:
        '204':
          description: No Content
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '422':
          description: Unprocessable entity
        '404':
          description: Not Found
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the namespace.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
  /api/v4/namespaces/storage/limit_exclusions:
    get:
      operationId: getApiV4NamespacesStorageLimitExclusions
      summary: Retrieve all limit exclusions
      description: Gets all records for namespaces that have been excluded
      tags:
      - Namespaces
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesNamespacesStorageLimitExclusion'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '400':
          description: Bad Request
      parameters:
      - name: page
        required: false
        description: Page number of results to retrieve.
        schema:
          type: integer
          default: 1
        in: query
        example: 1
      - name: per_page
        required: false
        description: Number of items to list per page.
        schema:
          type: integer
          default: 20
        in: query
        example: 20
  /api/v4/namespaces:
    get:
      operationId: getApiV4Namespaces
      summary: List all namespaces
      description: Lists all namespaces available to the current user. If the user is an administrator, this endpoint returns all namespaces in the instance.
      tags:
      - Namespaces
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesNamespace'
        '401':
          description: Unauthorized
        '400':
          description: Bad Request
      parameters:
      - name: search
        required: false
        description: Return only namespaces that contain the specified value in their name or path.
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: owned_only
        required: false
        description: If `true`, returns only namespaces owned by the current user.
        schema:
          type:
          - boolean
          - 'null'
        in: query
      - name: top_level_only
        required: false
        description: If `true`, returns only top-level namespaces.
        schema:
          type: boolean
          default: false
        in: query
      - name: full_path_search
        required: false
        description: If `true`, the `search` parameter is matched against the full path of the namespaces.
        schema:
          type: boolean
          default: false
        in: query
      - name: page
        required: false
        description: Page number of results to retrieve.
        schema:
          type: integer
          default: 1
        in: query
        example: 1
      - name: per_page
        required: false
        description: Number of items to list per page.
        schema:
          type: integer
          default: 20
        in: query
        example: 20
      - name: requested_hosted_plan
        required: false
        description: Name of the hosted plan requested by the customer.
        schema:
          type:
          - string
          - 'null'
        in: query
  /api/v4/namespaces/{id}/exists:
    get:
      operationId: getApiV4NamespacesIdExists
      summary: Verify namespace availability
      description: Verifies that a namespace is available for use.
      tags:
      - Namespaces
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesNamespaceExistence'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: Path of the namespace.
        schema:
          type: string
        in: path
      - name: parent_id
        required: false
        description: ID of the parent namespace. If omitted, only top-level namespaces are considered.
        schema:
          type:
          - integer
          - 'null'
        in: query
components:
  schemas:
    APIEntitiesGitlabSubscription:
      type: object
      properties:
        plan:
          type: object
          properties:
            code:
              type: string
            name:
              type: string
            trial:
              type: boolean
            auto_renew:
              type: boolean
            upgradable:
              type: boolean
            exclude_guests:
              type: boolean
        usage:
          type: object
          properties:
            seats_in_subscription:
              type: integer
            seats_in_use:
              type: integer
            max_seats_used:
              type: integer
            seats_owed:
              type: integer
        billing:
          type: object
          properties:
            subscription_start_date:
              type: string
              format: date
            subscription_end_date:
              type: string
              format: date
            trial_ends_on:
              type: string
              format: date
    putApiV4NamespacesIdRequest:
      type: object
      properties:
        shared_runners_minutes_limit:
          type:
          - integer
          - 'null'
          description: Compute minutes quota for the namespace.
        extra_shared_runners_minutes_limit:
          type:
          - integer
          - 'null'
          description: Extra compute minutes quota for the namespace.
        additional_purchased_storage_size:
          type:
          - integer
          - 'null'
          description: Additional storage size purchased for the namespace.
        additional_purchased_storage_ends_on:
          type:
          - string
          - 'null'
          format: date
          description: End of subscription of the additional purchased storage.
        gitlab_subscription_attributes:
          type:
          - object
          - 'null'
          description: Object that contains information on the GitLab subscription.
          properties:
            start_date:
              type:
              - string
              - 'null'
              format: date
              description: Start date of the subscription.
            seats:
              type:
              - integer
              - 'null'
              description: Number of seats in the subscription.
            max_seats_used:
              type:
              - integer
              - 'null'
              description: Highest number of active users in the last month.
            plan_code:
              type:
              - string
              - 'null'
              description: Subscription tier code.
            end_date:
              type:
              - string
              - 'null'
              format: date
              description: End date of the subscription.
            auto_renew:
              type:
              - boolean
              - 'null'
              description: If `true`, the subscription renews automatically on the end date.
            trial:
              type:
              - boolean
              - 'null'
              description: If `true`, the subscription is a trial.
            trial_ends_on:
              type:
              - string
              - 'null'
              format: date
              description: End date of the trial.
            trial_starts_on:
              type:
              - string
              - 'null'
              format: date
              description: Start date of the trial.
            trial_extension_type:
              type:
              - integer
              - 'null'
              description: Type of trial extension applied to the subscription. `1` means extended, `2` means reactivated.
    postApiV4NamespacesIdStorageLimitExclusionRequest:
      type: object
      properties:
        reason:
          type:
          - string
          - 'null'
          description: Reason the namespace is being excluded.
      required:
      - reason
    APIEntitiesNamespace:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 2
        name:
          type: string
          example: project
        path:
          type: string
          example: my_project
        kind:
          type: string
          example: project
        full_path:
          type: string
          example: group/my_project
        parent_id:
          type: integer
          format: int64
          example: 1
        avatar_url:
          type: string
          example: https://example.com/avatar/12345
        web_url:
          type: string
          example: https://example.com/group/my_project
        members_count_with_descendants:
          type: integer
          example: 5
        root_repository_size:
          type: integer
          example: 123
        projects_count:
          type: integer
          example: 123
        shared_runners_minutes_limit:
          type: integer
          example: 133
        ci_minutes_usage:
          $ref: '#/components/schemas/APIEntitiesCiMinutesUsage'
        extra_shared_runners_minutes_limit:
          type: integer
          example: 133
        additional_purchased_storage_size:
          type: integer
          example: 1000
        additional_purchased_storage_ends_on:
          type: string
          format: date
          example: '2022-06-18'
        billable_members_count:
          type: integer
          example: 2
        seats_in_use:
          type: integer
          example: 5
        max_seats_used:
          type: integer
          example: 100
        max_seats_used_changed_at:
          type: string
          format: date
          example: '2022-06-18'
        end_date:
          type: string
          format: date
          example: '2022-06-18'
        plan:
          type: string
          example: default
        trial_ends_on:
          type: string
          format: date
          example: '2022-06-18'
        trial:
          type: boolean
    APIEntitiesNamespaceExistence:
      type: object
      properties:
        exists:
          type: boolean
        suggests:
          type: array
          example:
          - my-group1
          items:
            type: string
    APIEntitiesNamespacesStorageLimitExclusion:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
        namespace_id:
          type: integer
          format: int64
          example: 123
        namespace_name:
          type: string
          example: GitLab
        reason:
          type: string
          example: a reason
    APIEntitiesCiMinutesUsage:
      type: object
      properties:
        total_minutes_used:
          type: integer
          example: 105
        monthly_minutes_used:
          type: integer
          example: 100
        purchased_minutes_used:
          type: integer
          example: 5
  securitySchemes:
    http:
      type: http
      scheme: bearer
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://gitlab.com/oauth/authorize
          tokenUrl: https://gitlab.com/oauth/token
          refreshUrl: https://gitlab.com/oauth/token
          scopes:
            api: Grants complete read/write access to the API, including all groups and projects, the container registry, the dependency proxy, and the package registry.
            read_api: Grants read access to the API, including all groups and projects, the container registry, and the package registry.
            read_user: Grants read-only access to your profile through the /user API endpoint, which includes username, public email, and full name. Also grants access to read-only API endpoints under /users.
            create_runner: Grants create access to the runners.
            manage_runner: Grants access to manage the runners.
            k8s_proxy: Grants permission to perform Kubernetes API calls using the agent for Kubernetes.
            self_rotate: Grants permission for token to rotate itself.
            mcp: Grants read-write access to remote Model Context Protocol (MCP) server for tools execution.
            mcp_orbit: Grants access to the Orbit Knowledge Graph MCP server for graph queries and schema retrieval.
    apiKey:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header