---
title: "Download a folder as a tar archive, streamed, any size."
method: GET
path: "/v1/sandboxes/{id}/files/archive"
tags: ["files"]
---

# Download a folder as a tar archive, streamed, any size.

`GET /v1/sandboxes/{id}/files/archive`

## Request

- Base URL: `https://api.withruntime.com`
- URL: `https://api.withruntime.com/v1/sandboxes/{id}/files/archive`
- Auth: HTTP bearer

Packed by tar inside the sandbox and streamed as it is made: application/x-tar, or application/gzip with gzip=true. Entries are relative to the folder (./a.txt). A folder that fails part way (a file it may not read, one that changes as it is read) ends as an archive every tar reader refuses, never as a short one that looks whole. Needs read_file. Wakes a paused sandbox, as other file calls do. At most 4 at once in a sandbox.

## Path parameters

- `id` string, required: Resource identifier (UUID).

## Query parameters

- `path` string: The folder, absolute, e.g. /workspace/app. An upload makes it and its parents, and merges into what is there.
- `gzip` boolean: Compress with gzip.
- `user` 'sandbox' | 'root': Run tar as the sandbox user, or as root through passwordless sudo.
- `exclude` string[]: Relative paths to leave out, such as .openai-agents-staging. Plain names only, no wildcards.

## Response `200`

Success

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/withruntime/apis/runtime-cloud-api.md) · [All operations](https://skmtc.dev/withruntime/apis/runtime-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/withruntime/apis/runtime-cloud-api/revisions/6f4012286988?raw)
