> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jhansi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Files

> Upload a single file or a full project into the sandbox workspace.

## Upload a single file

```http theme={null}
POST /v1/sandboxes/{id}/files
```

Multipart form upload. One file per request.

```bash theme={null}
curl -X POST http://localhost:8000/v1/sandboxes/sb_abc123/files \
  -F "file=@main.py"
```

```json theme={null}
{
  "filename": "main.py"
}
```

## Upload a project (zip)

```http theme={null}
POST /v1/sandboxes/{id}/upload
```

Upload a zip file containing your full project. Folder structure is preserved.

```bash theme={null}
curl -X POST http://localhost:8000/v1/sandboxes/sb_abc123/upload \
  -F "file=@project.zip"
```

```json theme={null}
{
  "status": "uploaded"
}
```

```json theme={null}
{
  "status": "uploaded"
}
```

### How to zip your project

Zip from inside your project folder so the structure is preserved:

```bash theme={null}
cd my_project && zip -r ../my_project.zip .
```

<Note>
  Do not zip the folder itself — zip the contents. Otherwise Petri extracts into a subfolder and paths will not resolve correctly.
</Note>

## Parameters

| Parameter | Type   | Required | Description                      |
| --------- | ------ | -------- | -------------------------------- |
| `id`      | string | Yes      | Sandbox ID returned from create. |
