---
title: "Upload a file"
method: PUT
path: "/sandboxes/{id}/files/{filePath}"
tags: ["Runtime"]
---

# Upload a file

`PUT /sandboxes/{id}/files/{filePath}`

Streams the raw request body to the destination path inside the sandbox.

**Body is the file bytes, not JSON, not multipart, not form-data.**

The parent directory must already exist; the server does **not** `mkdir -p`.

Size cap: 50 MB by default (`SANDBOX_MAX_FILE_SIZE_BYTES`). Include
`Content-Length` so oversize uploads are rejected before the body is read.

## Response `204`

File written

## Other responses

- `400` — Validation error / invalid state transition
- `403` — Plan / spending-limit / permission error
- `404` — Sandbox or related resource not found (also returned when owned by another user)

---

[API](https://skmtc.dev/brimblehq/apis/brimble-sandbox-api.md) · [All operations](https://skmtc.dev/brimblehq/apis/brimble-sandbox-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/brimblehq/brimble-sandbox-api/revisions/7fe2df041597/schema)
