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

# Files

> Upload, organize, and retrieve agent-produced files

Files are the core resource in AgentDrive. Any file your agent produces — PDFs, code, images, datasets, spreadsheets — can be stored and retrieved.

## File properties

| Property          | Description                                                 |
| ----------------- | ----------------------------------------------------------- |
| `id`              | Unique file identifier                                      |
| `drive_id`        | Drive this file belongs to                                  |
| `path`            | Full path within the drive (e.g., `reports/q1/summary.pdf`) |
| `filename`        | File name (e.g., `summary.pdf`)                             |
| `mime_type`       | Auto-detected MIME type                                     |
| `size`            | File size in bytes                                          |
| `content_hash`    | SHA-256 hash computed on upload                             |
| `content_preview` | First \~500 characters for text-based files                 |
| `tags`            | Array of string labels for filtering                        |
| `metadata`        | Custom key-value pairs                                      |
| `expires_at`      | Optional TTL — file auto-deletes after this timestamp       |

## Content upload

Files are uploaded as base64-encoded content in the request body. MIME type is auto-detected from the file extension, or you can set it explicitly via `content_type`.

## Content hash

A SHA-256 hash is computed on every upload. Use this to verify file integrity or detect duplicates.

## Content preview

For text-based files (`text/*`, `application/json`, `text/csv`), AgentDrive stores the first \~500 characters as `content_preview`. This lets agents and humans quickly see what a file contains without downloading it.

## Tags

Tags are string labels you attach to files for organization and filtering. Pass `tags` as a query parameter to filter file listings.

```json theme={null}
{ "tags": ["quarterly", "finance", "automated"] }
```

## TTL / expiring files

Set `expires_at` to an ISO 8601 timestamp and the file will be automatically deleted after that time. Useful for temporary agent outputs that don't need long-term storage.
