Download a repository as a zip archive
GET/api/repos/{owner}/{repo}/archive
downloadRepositoryArchive
Streams every file in the repository at the selected ref or commit as a zip archive, under one `{repo}-{ref}/` folder. Executable files keep mode 0755 and symlinks are stored as symlinks unless their target is absolute or climbs out of that folder; submodules, entries named `.git` (or an alias of it) and names that are not safe paths are left out. The whole tree is checked against the server's entry and path caps before the first byte is sent (413 past them). A download that crosses the size cap, or fails midway, is aborted rather than ended, so a truncated archive never reads as complete.
Authentication is not described for this operation in the spec — that does not mean it is public. Check tokens and scopes.
curl
curl -X GET 'https://neosource.dev/api/repos/OWNER/REPO/archive'fetch
fetch("https://neosource.dev/api/repos/OWNER/REPO/archive", {
method: "GET",
});Path parameters
ownerrequiredRepository owner or organization slug.
reporequiredRepository name.
Query parameters
refBookmark name (`main`, `feature/x`, `tags/v1`) or full 40-hex commit id to archive. Defaults to the repository's default branch.
Responses
200The zip archive
application/zip
—
304`If-None-Match` names the current `ETag`; the ref still resolves to the same commit
413The tree has more entries, trees or path bytes than the server archives
503This server is already building its maximum number of archives. Retry after the `Retry-After` header.
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 403Forbidden — one of: forbidden
- 404Not Found — one of: not_found
- 423Locked — one of: busy
- 429Rate limited — retry after the interval in the `Retry-After` header
- 500Internal server error
- 504Gateway timeout — the request exceeded the server's handling budget