Use this API to download, keep, and delete job artifacts.
Delete all job artifacts in a project
DELETE /api/v4/projects/{id}/artifacts
Deletes job artifacts from all jobs in a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
202 | Accepted | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
409 | Conflict | — |
Retrieve job artifacts
GET /api/v4/projects/{id}/jobs/artifacts/{ref_name}/download
Retrieves the artifacts archive for the latest successful job on a specified branch or tag.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
ref_Path, | String | Branch or tag name in repository.HEAD or SHA references are not supported |
jobQuery, | String | The name of the job |
job_Query | String | To be used with triggers for multi- |
search_Query | Boolean | Search across recent successful pipelines instead of just the latest one Default: false |
download_Query | String | Requested download transfer mode (proxy or direct).Allowed values: proxy,direct |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | String (binary) (application/) |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Download a specific file from artifacts archive from a ref
GET /api/v4/projects/{id}/jobs/artifacts/{ref_name}/raw/{artifact_path}
This feature was introduced in GitLab 11.5
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
ref_Path, | String | Branch or tag name in repository.HEAD or SHA references are not supported |
jobQuery, | String | The name of the job |
artifact_Path, | String | Path to a file inside the artifacts archive |
job_Query | String | To be used with triggers for multi- |
search_Query | Boolean | Search across recent successful pipelines instead of just the latest one Default: false |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Download an artifact from a job
GET /api/v4/projects/{id}/jobs/{job_id}/artifacts
This feature was introduced in GitLab 8.5. The file_type attribute was added in GitLab 19.4.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
job_Path, | Integer | The ID of a job |
file_Query | String | The type of artifact to download. Allowed values: accessibility,api_,archive,cobertura,jacoco,codequality,container_,dast,dependency_,dotenv,junit,license_,lsif,metrics,performance,browser_,load_,sast,secret_,requirements,requirements_,cluster_,cyclonedx,sarifDefault: archive |
job_Query | String | To be used with triggers for multi- |
download_Query | String | Requested download transfer mode (proxy or direct).Allowed values: proxy,direct |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | String (binary) (application/) |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Delete job artifacts
DELETE /api/v4/projects/{id}/jobs/{job_id}/artifacts
Deletes job artifacts from a specified job in a project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
job_Path, | Integer | The ID of a job |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
409 | Conflict | — |
Retain job artifacts
POST /api/v4/projects/{id}/jobs/{job_id}/artifacts/keep
Retains job artifacts. Prevents artifacts for a job from being automatically deleted when they reach their expiration date.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
job_Path, | Integer | The ID of a job |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
List all files in an artifacts archive
GET /api/v4/projects/{id}/jobs/{job_id}/artifacts/tree
Lists all files in a specified artifacts archive without extracting them.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
job_Path, | Integer | ID of a job Example: 42 |
pathQuery | String | Path to browse in the artifacts archive. Default: Example: coverage/ |
recursiveQuery | Boolean | If true,Default: falseExample: false |
job_Query | String | CI/ |
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 | — |
403 | Forbidden | — |
404 | Not found | — |
Download a specific file from artifacts archive
GET /api/v4/projects/{id}/jobs/{job_id}/artifacts/{artifact_path}
This feature was introduced in GitLab 10.0
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
job_Path, | Integer | The ID of a job |
artifact_Path, | String | Path to a file inside the artifacts archive |
job_Query | String | To be used with triggers for multi- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCiJob
| Property | Type | Description |
|---|---|---|
allow_ | Boolean | — |
archived | Boolean | Example:false |
artifacts | Array of APIEntities | — |
artifacts_ | String (date- | Example:2016- |
artifacts_ | APIEntities | — |
commit | APIEntities | — |
coverage | Number (float) | Example:98. |
created_ | String (date- | Example:2015- |
duration | Number (float) | Time spent running Example: 0. |
erased_ | String (date- | Example:2015- |
failure_ | String | Example:script_ |
finished_ | String (date- | Example:2015- |
id | Integer (int64) | Example:1 |
name | String | Example:deploy_ |
pipeline | APIEntities | — |
project | Object | — |
project. | String | Example:false |
queued_ | Number (float) | Time spent enqueued Example: 0. |
ref | String | Example:main |
runner | APIEntities | — |
runner_ | APIEntities | — |
stage | String | Example:deploy |
started_ | String (date- | Example:2015- |
status | String | Example:waiting_ |
tag | Boolean | — |
tag_ | Array of strings | Example:["ubuntu18", |
user | APIEntities | — |
web_ | String | Example:https: |
APIEntitiesCiJobArtifact
| Property | Type | Description |
|---|---|---|
file_ | String | Allowed values:raw,zip,gzipExample: zip |
file_ | String | Allowed values:archive,metadata,trace,junit,sast,dependency_,container_,dast,codequality,license_,performance,metrics,metrics_,network_,lsif,dotenv,cobertura,terraform,accessibility,cluster_,secret_,requirements,coverage_,browser_,load_,api_,cluster_,cyclonedx,requirements_,annotations,repository_,jacoco,sarifExample: archive |
filename | String | Example:artifacts. |
size | Integer | Example:1000 |
APIEntitiesCiJobArtifactEntry
| Property | Type | Description |
|---|---|---|
mode | String | Example:100644 |
name | String | Example:index. |
path | String | Example:coverage/ |
size | Integer | Example:12345 |
type | String | Allowed values:file,directoryExample: file |
APIEntitiesCiJobArtifactFile
| Property | Type | Description |
|---|---|---|
filename | String | Example:artifacts. |
size | Integer | Example:1000 |
APIEntitiesCiPipelineBasic
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2022- |
id | Integer (int64) | Example:1 |
iid | Integer | Example:2 |
project_ | Integer (int64) | Example:3 |
ref | String | Example:feature- |
sha | String | Example:0ec9e58fdfca6cdd6652 |
source | String | Example:push |
status | String | Example:success |
updated_ | String (date- | Example:2022- |
web_ | String | Example:https: |
APIEntitiesCiRunner
| Property | Type | Description |
|---|---|---|
active | Boolean | Example:true |
created_ | String (date- | Example:2025- |
created_ | APIEntities | — |
description | String | Example:test- |
id | Integer (int64) | Example:8 |
ip_ | String | Example:127. |
is_ | Boolean | Example:true |
job_ | String | Allowed values:active,idleExample: idle |
name | String | Example:test |
online | Boolean | Example:true |
paused | Boolean | Example:false |
runner_ | String | Allowed values:instance_,group_,project_Example: instance_ |
status | String | Example:online |
APIEntitiesCiRunnerManager
| Property | Type | Description |
|---|---|---|
architecture | String | Example:amd64 |
contacted_ | String | Example:2023- |
created_ | String | Example:2023- |
id | Integer (int64) | Example:8 |
ip_ | String | Example:127. |
job_ | String | Allowed values:active,idleExample: idle |
platform | String | Example:linux |
revision | String | Example:91a27b2a |
status | String | Example:online |
system_ | String | Example:runner- |
version | String | Example:16. |
APIEntitiesCommit
| Property | Type | Description |
|---|---|---|
author_ | String | Example:john@example. |
author_ | String | Example:John Smith |
authored_ | String (date- | Example:2012- |
committed_ | String (date- | Example:2012- |
committer_ | String | Example:jack@example. |
committer_ | String | Example:Jack Smith |
created_ | String (date- | Example:2017- |
extended_ | Object | Example:{"Signed- |
id | String | Example:2695effb5807a22ff3d1 |
message | String | Example:Initial commit |
parent_ | Array of strings | Example:["2a4b78934375d7f53875 |
short_ | String | Example:2695effb |
title | String | Example:Initial commit |
trailers | Object | Example:{"Merged- |
web_ | String | Example:https: |
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesUser
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | Example:https: |
bio | String | — |
bot | Boolean | — |
created_ | String | — |
custom_ | Array of APIEntities | — |
discord | String | — |
followers | String | — |
following | String | — |
github | String | — |
id | Integer (int64) | Example:1 |
is_ | String | — |
job_ | String | — |
linkedin | String | — |
local_ | String | — |
location | String | — |
locked | Boolean | — |
name | String | Example:Administrator |
organization | String | — |
pronouns | String | — |
public_ | String | Example:john@example. |
state | String | Example:active |
twitter | String | — |
username | String | Example:admin |
web_ | String | Example:https: |
website_ | String | — |
work_ | String | — |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | Example:https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | Example:1 |
locked | Boolean | — |
name | String | Example:Administrator |
public_ | String | Example:john@example. |
state | String | Example:active |
username | String | Example:admin |
web_ | String | Example:https: |