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

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project

Responses

CodeDescriptionSchema
202Accepted—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—
409Conflict—

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

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
ref_name
Path, required
StringBranch or tag name in the repository. HEAD or SHA references are not supported. For merge request pipelines, use refs/merge-requests/:iid/head instead of the branch name
job
Query, required
StringName of the job
job_token
Query
StringCI/CD job token for multi-project pipelines. Premium and Ultimate only
search_recent_successful_pipelines
Query
BooleanIf true, searches across recent successful pipelines instead of just the latest one. Introduced in GitLab 18.7 with a feature flag named ci_search_recent_successful_pipelines. Disabled by default
Default: false
download_mode
Query
StringRequested download transfer mode (proxy or direct). Only honored when allowed by the object storage configuration
Allowed values: proxy, direct

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
401Unauthorized—
403Forbidden—
404Not 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

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
ref_name
Path, required
StringBranch or tag name in the repository. HEAD or SHA references are not supported. For merge request pipelines, use refs/merge-requests/:iid/head instead of the branch name
job
Query, required
StringName of the job
artifact_path
Path, required
StringPath to a file inside the artifacts archive
job_token
Query
StringCI/CD job token for multi-project pipelines. Premium and Ultimate only
search_recent_successful_pipelines
Query
BooleanIf true, searches across recent successful pipelines instead of just the latest one. Introduced in GitLab 18.7 with a feature flag named ci_search_recent_successful_pipelines. Disabled by default
Default: false

Responses

CodeDescriptionSchema
200OK—
400Bad request—
401Unauthorized—
403Forbidden—
404Not 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

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
job_id
Path, required
IntegerID of the job
file_type
Query
StringType of artifact to download. Set a specific report type to download that report file directly instead of the full artifacts archive. performance and browser_performance share a report group. If the job uploaded both, the requested type is returned, and if it uploaded only one, that artifact is returned whichever type was requested. Introduced in GitLab 19.4
Allowed values: accessibility, api_fuzzing, archive, cobertura, jacoco, codequality, container_scanning, dast, dependency_scanning, dotenv, junit, license_scanning, lsif, metrics, performance, browser_performance, load_performance, sast, secret_detection, requirements, requirements_v2, cluster_image_scanning, cyclonedx, sarif
Default: archive
job_token
Query
StringCI/CD job token for multi-project pipelines. Premium and Ultimate only
download_mode
Query
StringRequested download transfer mode (proxy or direct). Only honored when allowed by the object storage configuration
Allowed values: proxy, direct

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Delete job artifacts

DELETE /api/v4/projects/{id}/jobs/{job_id}/artifacts

Deletes job artifacts from a specified job in a project.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
job_id
Path, required
IntegerID of the job

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—
409Conflict—

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

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
job_id
Path, required
IntegerID of the job

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesCiJob
400Bad Request—
401Unauthorized—
403Forbidden—
404Not 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

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
job_id
Path, required
IntegerID of the job
Example: 42
path
Query
StringPath to browse in the artifacts archive. Defaults to the root directory
Default: ``
Example: coverage/reports
recursive
Query
BooleanIf true, returns all entries recursively
Default: false
Example: false
job_token
Query
StringCI/CD job token for multi-project pipelines. Premium and Ultimate only
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKArray of APIEntitiesCiJobArtifactEntry
400Bad Request—
401Unauthorized—
403Forbidden—
404Not 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

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project
job_id
Path, required
IntegerID of the job
artifact_path
Path, required
StringPath to a file inside the artifacts archive
job_token
Query
StringCI/CD job token for multi-project pipelines. Premium and Ultimate only

Responses

CodeDescriptionSchema
200OK—
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesCiJob

PropertyTypeDescription
allow_failureBoolean—
archivedBooleanExample: false
artifactsArray of APIEntitiesCiJobArtifact—
artifacts_expire_atString (date-time)Example: 2016-01-19T09:05:50.355Z
artifacts_fileAPIEntitiesCiJobArtifactFile—
commitAPIEntitiesCommit—
coverageNumber (float)Example: 98.29
created_atString (date-time)Example: 2015-12-24T15:51:21.880Z
durationNumber (float)Time spent running
Example: 0.465
erased_atString (date-time)Example: 2015-12-24T18:00:29.728Z
failure_reasonStringExample: script_failure
finished_atString (date-time)Example: 2015-12-24T17:54:31.198Z
idInteger (int64)Example: 1
nameStringExample: deploy_to_production
pipelineAPIEntitiesCiPipelineBasic—
projectObject—
project.ci_job_token_scope_enabledStringExample: false
queued_durationNumber (float)Time spent enqueued
Example: 0.123
refStringExample: main
runnerAPIEntitiesCiRunner—
runner_managerAPIEntitiesCiRunnerManager—
stageStringExample: deploy
started_atString (date-time)Example: 2015-12-24T17:54:30.733Z
statusStringExample: waiting_for_resource
tagBoolean—
tag_listArray of stringsExample: ["ubuntu18","docker runner"]
userAPIEntitiesUser—
web_urlStringExample: https://example.com/foo/bar/-/jobs/1

APIEntitiesCiJobArtifact

PropertyTypeDescription
file_formatStringAllowed values: raw, zip, gzip
Example: zip
file_typeStringAllowed values: archive, metadata, trace, junit, sast, dependency_scanning, container_scanning, dast, codequality, license_scanning, performance, metrics, metrics_referee, network_referee, lsif, dotenv, cobertura, terraform, accessibility, cluster_applications, secret_detection, requirements, coverage_fuzzing, browser_performance, load_performance, api_fuzzing, cluster_image_scanning, cyclonedx, requirements_v2, annotations, repository_xray, jacoco, sarif
Example: archive
filenameStringExample: artifacts.zip
sizeIntegerExample: 1000

APIEntitiesCiJobArtifactEntry

PropertyTypeDescription
modeStringExample: 100644
nameStringExample: index.html
pathStringExample: coverage/index.html
sizeIntegerExample: 12345
typeStringAllowed values: file, directory
Example: file

APIEntitiesCiJobArtifactFile

PropertyTypeDescription
filenameStringExample: artifacts.zip
sizeIntegerExample: 1000

APIEntitiesCiPipelineBasic

PropertyTypeDescription
created_atString (date-time)Example: 2022-10-21T16:49:48.000+02:00
idInteger (int64)Example: 1
iidIntegerExample: 2
project_idInteger (int64)Example: 3
refStringExample: feature-branch
shaStringExample: 0ec9e58fdfca6cdd6652c083c9edb53abc0bad52
sourceStringExample: push
statusStringExample: success
updated_atString (date-time)Example: 2022-10-21T16:49:48.000+02:00
web_urlStringExample: https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61

APIEntitiesCiRunner

PropertyTypeDescription
activeBooleanExample: true
created_atString (date-time)Example: 2025-05-03T00:00:00.000Z
created_byAPIEntitiesUserBasic—
descriptionStringExample: test-1-20150125
idInteger (int64)Example: 8
ip_addressStringExample: 127.0.0.1
is_sharedBooleanExample: true
job_execution_statusStringAllowed values: active, idle
Example: idle
nameStringExample: test
onlineBooleanExample: true
pausedBooleanExample: false
runner_typeStringAllowed values: instance_type, group_type, project_type
Example: instance_type
statusStringExample: online

APIEntitiesCiRunnerManager

PropertyTypeDescription
architectureStringExample: amd64
contacted_atStringExample: 2023-10-24T01:27:06.549Z
created_atStringExample: 2023-10-24T01:27:06.549Z
idInteger (int64)Example: 8
ip_addressStringExample: 127.0.0.1
job_execution_statusStringAllowed values: active, idle
Example: idle
platformStringExample: linux
revisionStringExample: 91a27b2a
statusStringExample: online
system_idStringExample: runner-1
versionStringExample: 16.11.0

APIEntitiesCommit

PropertyTypeDescription
author_emailStringExample: john@example.com
author_nameStringExample: John Smith
authored_dateString (date-time)Example: 2012-05-28T04:42:42-07:00
committed_dateString (date-time)Example: 2012-05-28T04:42:42-07:00
committer_emailStringExample: jack@example.com
committer_nameStringExample: Jack Smith
created_atString (date-time)Example: 2017-07-26T11:08:53.000+02:00
extended_trailersObjectExample: {"Signed-off-by":["John Doe \u003cjohndoe@gitlab.com\u003e","Jane Doe \u003cjanedoe@gitlab.com\u003e"]}
idStringExample: 2695effb5807a22ff3d138d593fd856244e155e7
messageStringExample: Initial commit
parent_idsArray of stringsExample: ["2a4b78934375d7f53875269ffd4f45fd83a84ebe"]
short_idStringExample: 2695effb
titleStringExample: Initial commit
trailersObjectExample: {"Merged-By":"Jane Doe janedoe@gitlab.com"}
web_urlStringExample: https://gitlab.example.com/janedoe/gitlab-foss/-/commit/ed899a2f4b50b4370feeea94676502b42383c746

APIEntitiesCustomAttribute

PropertyTypeDescription
keyStringExample: foo
valueStringExample: bar

APIEntitiesUser

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringExample: https://gravatar.com/avatar/1
bioString—
botBoolean—
created_atString—
custom_attributesArray of APIEntitiesCustomAttribute—
discordString—
followersString—
followingString—
githubString—
idInteger (int64)Example: 1
is_followedString—
job_titleString—
linkedinString—
local_timeString—
locationString—
lockedBoolean—
nameStringExample: Administrator
organizationString—
pronounsString—
public_emailStringExample: john@example.com
stateStringExample: active
twitterString—
usernameStringExample: admin
web_urlStringExample: https://gitlab.example.com/root
website_urlString—
work_informationString—

APIEntitiesUserBasic

PropertyTypeDescription
avatar_pathStringExample: /user/avatar/28/The-Big-Lebowski-400-400.png
avatar_urlStringExample: https://gravatar.com/avatar/1
custom_attributesArray of APIEntitiesCustomAttribute—
idInteger (int64)Example: 1
lockedBoolean—
nameStringExample: Administrator
public_emailStringExample: john@example.com
stateStringExample: active
usernameStringExample: admin
web_urlStringExample: https://gitlab.example.com/root