Skip to content

Retrieve file archive from a repository

GET
/api/v4/projects/{id}/repository/archive

Retrieves the file archive of a specified repository. This endpoint can be accessed without authentication if the repository is publicly accessible. For GitLab.com users, this endpoint has a rate limit threshold of 5 requests per minute.

id
required
One of:
string

The ID or URL-encoded path of the project

Example
1
sha
string
nullable

The commit sha of the archive to be downloaded

Example
7d70e02340bac451f281cecf0a980907974bd8be
ref_type
string
nullable
Allowed values: heads tags

Type of ref in sha, heads (branch) or tags (tag)

format
string
nullable

The archive format

Example
tar.gz
path
string
nullable

Subfolder of the repository to be downloaded

Example
files/archives
include_lfs_blobs
boolean
default: true nullable

Used to exclude LFS objects from archive

exclude_paths
Array<string>
nullable

Comma-separated list of paths to exclude from the archive

OK

Bad Request

Not Found