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

# File Management

> Read, write, and browse files inside sandboxes

The file API lets you interact with the filesystem inside your sandboxes.

## Endpoints

All file operations are scoped to a sandbox ID. Available for both E2B and Daytona:

* `GET /api/e2b/<sandboxId>/files/list` — List files in a directory
* `GET /api/e2b/<sandboxId>/files/read` — Read file contents
* `POST /api/e2b/<sandboxId>/files/write` — Write file contents
* `GET /api/e2b/<sandboxId>/files/info` — Get file metadata

Replace `e2b` with `daytona` for Daytona sandboxes.

## Examples

### List files

```bash theme={null}
curl "https://api.yolocode.ai/api/e2b/<sandboxId>/files/list?path=/home/user/project" \
  -H "Authorization: Bearer <token>"
```

### Read a file

```bash theme={null}
curl "https://api.yolocode.ai/api/e2b/<sandboxId>/files/read?path=/home/user/project/package.json" \
  -H "Authorization: Bearer <token>"
```

### Write a file

```bash theme={null}
curl -X POST "https://api.yolocode.ai/api/e2b/<sandboxId>/files/write" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/home/user/project/hello.txt",
    "content": "Hello from Yolocode!"
  }'
```

### Get file info

```bash theme={null}
curl "https://api.yolocode.ai/api/e2b/<sandboxId>/files/info?path=/home/user/project/package.json" \
  -H "Authorization: Bearer <token>"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.