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.
Receives notifications from the container registry when an operation occurs
POST /api/v4/container_registry_event/events
This feature was introduced in GitLab 12.10
Responses
| Code | Description | Schema |
|---|---|---|
200 | Success | — |
400 | Bad Request | — |
401 | Invalid Token | — |
List all registry repositories for a group
GET /api/v4/groups/{id}/registry/repositories
Lists all registry repositories for a specified group.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
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 | — |
404 | Group Not Found | — |
List all registry repositories for a project
GET /api/v4/projects/{id}/registry/repositories
Lists all registry repositories for a specified project. Responses are paginated and return 20 results by default.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
tagsQuery | Boolean | Determines if tags should be included Default: false |
tags_Query | Boolean | Determines if the tags count should be included Default: false |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
Delete registry repository
DELETE /api/v4/projects/{id}/registry/repositories/{repository_id}
Deletes a specified repository in the registry. This operation is executed asynchronously and might take some time to execute.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
repository_Path, | Integer | The ID of the repository |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Success | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
List all registry repository tags for a project
GET /api/v4/projects/{id}/registry/repositories/{repository_id}/tags
Lists all tags for a specified registry repository. Responses are paginated and return 20 results by default.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
repository_Path, | Integer | The ID of the repository |
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 | — |
404 | Not Found | — |
405 | Method Not Allowed | — |
Delete multiple registry repository tags
DELETE /api/v4/projects/{id}/registry/repositories/{repository_id}/tags
Deletes multiple registry repository tags based on the specified criteria.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
repository_Path, | Integer | The ID of the repository |
name_Query | String | The tag name regexp to delete, |
name_Query | String | The tag name regexp to delete, |
name_Query | String | The tag name regexp to retain |
keep_Query | Integer | Keep n of latest tags with matching name |
older_Query | String | Delete older than: |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Success | — |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
Retrieve details of a registry repository tag
GET /api/v4/projects/{id}/registry/repositories/{repository_id}/tags/{tag_name}
Retrieves details of a specified registry repository tag.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
repository_Path, | Integer | The ID of the repository |
tag_Path, | String | The name of the tag |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Not Found | — |
Delete a registry repository tag
DELETE /api/v4/projects/{id}/registry/repositories/{repository_id}/tags/{tag_name}
Deletes a specified container registry repository tag.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
repository_Path, | Integer | The ID of the repository |
tag_Path, | String | The name of the tag |
Responses
| Code | Description | Schema |
|---|---|---|
204 | Success | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Retrieve details of a container registry repository
GET /api/v4/registry/repositories/{id}
Retrieves details of a specified container registry repository.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID of the repository |
tagsQuery | Boolean | Determines if tags should be included Default: false |
tags_Query | Boolean | Determines if the tags count should be included Default: false |
sizeQuery | Boolean | Determines if the size should be included Default: false |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Repository Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesContainerRegistryRepository
| Property | Type | Description |
|---|---|---|
cleanup_ | String (date- | Example:2020- |
created_ | String (date- | Example:2019- |
delete_ | String | Example:delete/ |
id | Integer (int64) | Example:1 |
location | String | Example:gitlab. |
name | String | Example:releases |
path | String | Example:group/ |
project_ | Integer (int64) | Example:9 |
size | Integer | Example:12345 |
status | String | Example:delete_ |
tags | APIEntities | — |
tags_ | Integer | Example:3 |
APIEntitiesContainerRegistryTag
| Property | Type | Description |
|---|---|---|
location | String | Example:registry. |
name | String | Example:latest |
path | String | Example:namespace1/ |
APIEntitiesContainerRegistryTagDetails
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2022- |
digest | String | Example:shadigest |
location | String | Example:registry. |
name | String | Example:latest |
path | String | Example:namespace1/ |
revision | String | Example:tagrevision |
short_ | String | Example:shortrevison |
total_ | Integer | Example:3 |