GitLab Container registry API

Use this API to manage the [GitLab container registry](https://docs.gitlab.com/user/packages/container_registry/): list the registry repositories in a project or a group, retrieve or delete individual repositories and their tags, and receive registry events. To authenticate with these endpoints from a CI/CD job, pass the [`$CI_JOB_TOKEN`](https://docs.gitlab.com/ci/jobs/ci_job_token/) variable as the `JOB-TOKEN` header. The job token only has access to the container registry of the project that created the pipeline.

Operations 9

GET /api/v4/projects/{id}/registry/repositories List all registry repositories for a project #
DELETE /api/v4/projects/{id}/registry/repositories/{repository_id} Delete registry repository #
GET /api/v4/projects/{id}/registry/repositories/{repository_id}/tags List all registry repository tags for a project #
DELETE /api/v4/projects/{id}/registry/repositories/{repository_id}/tags Delete multiple registry repository tags #
GET /api/v4/projects/{id}/registry/repositories/{repository_id}/tags/{tag_name} Retrieve details of a registry repository tag #
DELETE /api/v4/projects/{id}/registry/repositories/{repository_id}/tags/{tag_name} Delete a registry repository tag #
GET /api/v4/groups/{id}/registry/repositories List all registry repositories for a group #
GET /api/v4/registry/repositories/{id} Retrieve details of a container registry repository #
POST /api/v4/container_registry_event/events Receives notifications from the container registry when an operation occurs #

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-container-registry-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-container-registry-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab REST Container registry 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: Container registry
  description: 'Use this API to manage the GitLab container registry:

    list the registry repositories in a project or a group, retrieve or delete individual repositories and

    their tags, and receive registry events.


    To authenticate with these endpoints from a CI/CD job, pass the `$CI_JOB_TOKEN`

    variable as the `JOB-TOKEN` header. The job token only has access to the container registry

    of the project that created the pipeline.'
  x-displayName: Container registry
  externalDocs:
    url: https://docs.gitlab.com/api/container_registry/
paths:
  /api/v4/projects/{id}/registry/repositories:
    get:
      operationId: getApiV4ProjectsIdRegistryRepositories
      summary: List all registry repositories for a project
      description: Lists all registry repositories for a specified project. Responses are paginated and return 20 results by default.
      tags:
      - Container registry
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesContainerRegistryRepository'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - 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: tags
        required: false
        description: If `true`, includes an array of `tags` in the response.
        schema:
          type: boolean
          default: false
        in: query
      - name: tags_count
        required: false
        description: If `true`, includes `tags_count` in the response.
        schema:
          type: boolean
          default: false
        in: query
  /api/v4/projects/{id}/registry/repositories/{repository_id}:
    delete:
      operationId: deleteApiV4ProjectsIdRegistryRepositoriesRepositoryId
      summary: Delete registry repository
      description: Deletes a specified repository in the registry. This operation is executed asynchronously and might take some time to execute.
      tags:
      - Container registry
      responses:
        '204':
          description: Success
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: repository_id
        required: true
        description: ID of the container registry repository.
        schema:
          type: integer
        in: path
  /api/v4/projects/{id}/registry/repositories/{repository_id}/tags:
    get:
      operationId: getApiV4ProjectsIdRegistryRepositoriesRepositoryIdTags
      summary: List all registry repository tags for a project
      description: Lists all tags for a specified registry repository. Responses are paginated and return 20 results by default.
      tags:
      - Container registry
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesContainerRegistryTag'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '405':
          description: Method Not Allowed
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: repository_id
        required: true
        description: ID of the container registry repository.
        schema:
          type: integer
        in: path
      - name: order_by
        required: false
        description: Field to order tags by. `published_at` requires keyset pagination.
        schema:
          type: string
          default: name
        in: query
      - name: sort
        required: false
        description: Direction to sort tags in. Only applies to keyset pagination.
        schema:
          type: string
          default: asc
        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
    delete:
      operationId: deleteApiV4ProjectsIdRegistryRepositoriesRepositoryIdTags
      summary: Delete multiple registry repository tags
      description: Deletes multiple registry repository tags based on the specified criteria.
      tags:
      - Container registry
      responses:
        '204':
          description: Success
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: repository_id
        required: true
        description: ID of the container registry repository.
        schema:
          type: integer
        in: path
      - name: name_regex_delete
        required: false
        description: '[RE2](https://github.com/google/re2/wiki/Syntax) regular expression of the tag names to delete. Specify `.*` to delete all tags. At least one of `name_regex`, `name_regex_delete` must be provided.'
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: name_regex
        required: false
        description: '[RE2](https://github.com/google/re2/wiki/Syntax) regular expression of the tag names to delete. Specify `.*` to delete all tags. Deprecated. Use `name_regex_delete` instead. At least one of `name_regex`, `name_regex_delete` must be provided.'
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: name_regex_keep
        required: false
        description: '[RE2](https://github.com/google/re2/wiki/Syntax) regular expression of the tag names to keep. Overrides any matches from `name_regex_delete`. Setting to `.*` results in a no-op.'
        schema:
          type:
          - string
          - 'null'
        in: query
      - name: keep_n
        required: false
        description: Number of most recent tags with a matching name to keep.
        schema:
          type:
          - integer
          - 'null'
        in: query
      - name: older_than
        required: false
        description: Delete tags older than this age, such as `1h`, `1d`, or `1month`.
        schema:
          type:
          - string
          - 'null'
        in: query
  /api/v4/projects/{id}/registry/repositories/{repository_id}/tags/{tag_name}:
    get:
      operationId: getApiV4ProjectsIdRegistryRepositoriesRepositoryIdTagsTagName
      summary: Retrieve details of a registry repository tag
      description: Retrieves details of a specified registry repository tag.
      tags:
      - Container registry
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesContainerRegistryTagDetails'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: repository_id
        required: true
        description: ID of the container registry repository.
        schema:
          type: integer
        in: path
      - name: tag_name
        required: true
        description: Name of the tag.
        schema:
          type: string
        in: path
    delete:
      operationId: deleteApiV4ProjectsIdRegistryRepositoriesRepositoryIdTagsTagName
      summary: Delete a registry repository tag
      description: Deletes a specified container registry repository tag.
      tags:
      - Container registry
      responses:
        '204':
          description: Success
        '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 project.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: repository_id
        required: true
        description: ID of the container registry repository.
        schema:
          type: integer
        in: path
      - name: tag_name
        required: true
        description: Name of the tag.
        schema:
          type: string
        in: path
  /api/v4/groups/{id}/registry/repositories:
    get:
      operationId: getApiV4GroupsIdRegistryRepositories
      summary: List all registry repositories for a group
      description: Lists all registry repositories for a specified group.
      tags:
      - Container registry
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesContainerRegistryRepository'
        '401':
          description: Unauthorized
        '404':
          description: Group Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID or URL-encoded path of the group.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - 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/registry/repositories/{id}:
    get:
      operationId: getApiV4RegistryRepositoriesId
      summary: Retrieve details of a container registry repository
      description: Retrieves details of a specified container registry repository.
      tags:
      - Container registry
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesContainerRegistryRepository'
        '401':
          description: Unauthorized
        '404':
          description: Repository Not Found
        '400':
          description: Bad Request
      parameters:
      - name: id
        required: true
        description: ID of the repository.
        schema:
          oneOf:
          - type: string
          - type: integer
        in: path
      - name: tags
        required: false
        description: If `true`, includes an array of `tags` in the response.
        schema:
          type: boolean
          default: false
        in: query
      - name: tags_count
        required: false
        description: If `true`, includes `tags_count` in the response.
        schema:
          type: boolean
          default: false
        in: query
      - name: size
        required: false
        description: If `true`, response includes the deduplicated size of all images in the repository. Only available on GitLab.com for repositories created after `2021-11-04`.
        schema:
          type: boolean
          default: false
        in: query
  /api/v4/container_registry_event/events:
    post:
      operationId: postApiV4ContainerRegistryEventEvents
      summary: Receives notifications from the container registry when an operation occurs
      description: This feature was introduced in GitLab 12.10
      tags:
      - Container registry
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Token
        '400':
          description: Bad Request
components:
  schemas:
    APIEntitiesContainerRegistryTag:
      type: object
      properties:
        name:
          type: string
          example: latest
        path:
          type: string
          example: namespace1/project1/test_image_1:latest
        location:
          type: string
          example: registry.dev/namespace1/project1/test_image_1:latest
    APIEntitiesContainerRegistryRepository:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
        name:
          type: string
          example: releases
        path:
          type: string
          example: group/project/releases
        project_id:
          type: integer
          format: int64
          example: 9
        location:
          type: string
          example: gitlab.example.com/group/project/releases
        created_at:
          type: string
          format: date-time
          example: '2019-01-10T13:39:08.229Z'
        cleanup_policy_started_at:
          type: string
          format: date-time
          example: '2020-08-17T03:12:35.489Z'
        tags_count:
          type: integer
          example: 3
        tags:
          $ref: '#/components/schemas/APIEntitiesContainerRegistryTag'
        delete_api_path:
          type: string
          example: delete/api/path
        size:
          type: integer
          example: 12345
        status:
          type: string
          example: delete_scheduled
    APIEntitiesContainerRegistryTagDetails:
      type: object
      properties:
        name:
          type: string
          example: latest
        path:
          type: string
          example: namespace1/project1/test_image_1:latest
        location:
          type: string
          example: registry.dev/namespace1/project1/test_image_1:latest
        revision:
          type: string
          example: tagrevision
        short_revision:
          type: string
          example: shortrevison
        digest:
          type: string
          example: shadigest
        created_at:
          type: string
          format: date-time
          example: '2022-01-10T13:39:08.229Z'
        total_size:
          type: integer
          example: 3
  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