---
docId: doc_ad7d9e7bfffa4d1eab1fe5440a9524b1
title: 'Files'
description: 'Texts, web pages and documents your agents consult to answer. A file lives once in the workspace and is connected to the agents that need it.'
---

<script>
  import { Ways, Collapsible } from '$lib/components';
</script>

# Files

Give an agent information to use in its replies: text, web pages or documents (PDF, Word, Excel, PowerPoint, Markdown, CSV, HTML and images). [Create a file](/api-reference/files/create) or [upload a document](/api-reference/files/upload), then connect it to the agents that need it. Each file is stored and processed once in the workspace.

## Quick example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
# 1. Create the file connected to the agent (answers 202 with fileId and uploadId)
curl -X POST https://api.platic.ai/v1/files \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "url",
    "url": "https://acme.com/policies",
    "refresh": { "intervalHours": 24 },
    "attachment": { "agentId": "'"$AGENT_ID"'" }
  }'

# 2. Read the processing until terminal is true
curl https://api.platic.ai/v1/agents/$AGENT_ID/files/$FILE_ID/jobs/$UPLOAD_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
import { readFileSync } from "node:fs";

// Up to 1 MiB goes inline; from 1 to 50 MiB the SDK opens the upload session itself
const file = await platic.files.createFile({
  data: readFileSync("./prices.pdf"),
  fileName: "prices.pdf",
  attachment: { agentId },
});

const job = await platic.agents.files.waitForJob(agentId, file.fileId, file.uploadId);
// With job.status === "ready", the agent already uses it
```

</Ways.Way>
</Ways>

## What you need to know

<span id="processing"></span>
<span id="activate-on-ready"></span>
<span id="automatic-names"></span>

- **They apply live:** [connecting](/api-reference/agents/files/connect), [pausing or scheduling](/api-reference/agents/files/schedule) or [editing](/api-reference/files/update) a file takes effect immediately, without publishing the agent. Editing a file changes the content for every agent that uses it; pausing or scheduling it affects only that agent.
- **Background processing (`202`):** creating, replacing or [reprocessing](/api-reference/files/reprocess) opens a [processing](/api-reference/files/processing) (`uploadId`) that goes through `awaiting_upload` -> `queued` -> `parsing` -> `chunking` -> `embedding` -> `ready` or `failed`. If you create it with `attachment.agentId`, the connection starts paused and activates by itself when it reaches `ready` (`activateOnReady: true`). While a replacement is processing, agents keep using the previous version.
- **AI-generated names:** if you omit `title` or `description`, Platica generates them automatically when it finishes processing the content (you can also ask for a proposal without saving with [Suggest metadata](/api-reference/files/suggest-metadata)).
- **Up-to-date pages:** a `url` file can re-read itself every `6`, `12`, `24`, `48`, `72`, `168`, `336` or `720` hours (`refresh.intervalHours`).

<span id="limits"></span>
- **Size:** text up to 1 MiB; documents up to 1 MiB in base64 with [Create a file](/api-reference/files/create), or up to 50 MiB with [Upload a file](/api-reference/files/upload).
- **Workspace:** at most 30 simultaneous processing jobs, 1,000 files and 3 GiB of storage.
- **Validity:** download links, 5 min; `confirmationToken` to [delete](/api-reference/files/delete), 10 min. Scheduling up to 366 days.

<span id="permissions"></span>
- **Permissions:** listing, creating without an agent, connecting and deleting require **Integrations**. Creating with `attachment.agentId`, pausing, scheduling or disconnecting only require being able to edit that agent.

## Endpoints

| Method | Endpoint | What it does |
|--------|----------|--------------|
| `GET` | [`/v1/files`](/api-reference/files/list) | List the workspace's files |
| `POST` | [`/v1/files`](/api-reference/files/create) | Create from text, a web page or a document (up to 1 MiB) |
| `POST` | [`/v1/files/upload`](/api-reference/files/upload) | Open an upload session for a document (1 to 50 MiB) |
| `GET` | [`/v1/files/{fileId}`](/api-reference/files/get) | Get metadata, text (`content`), download or `affectedAgents` |
| `PATCH` | [`/v1/files/{fileId}`](/api-reference/files/update) | Change title, description, `refresh` or replace content |
| `POST` | [`/v1/files/{fileId}/reprocess`](/api-reference/files/reprocess) | Re-read the page or the original file |
| `POST` | [`/v1/files/{fileId}/metadata/suggestion`](/api-reference/files/suggest-metadata) | Suggest a title and description with AI without saving |
| `DELETE` | [`/v1/files/{fileId}`](/api-reference/files/delete) | Delete from the workspace and from all agents |
| `GET` | [`/v1/files/{fileId}/jobs/{uploadId}`](/api-reference/files/processing) | Read a processing's state |

To connect, pause, schedule or disconnect files of a specific agent, go to [Agent files](/api-reference/agents/files/list).

<span id="common-errors"></span>

The error codes (`FILE_JOB_IN_PROGRESS`, `FILE_NOT_READY`, `STORAGE_LIMIT_EXCEEDED`, `QUOTA_EXCEEDED`, `CONFLICT`) are in [Errors](/api-reference/errors#files) and the tools for AI assistants are in the [Files MCP tools](/mcp/tools#files).

## Document formats

<Collapsible summary="View supported extensions">

`pdf`, `doc`, `docx`, `xls`, `xlsx`, `ppt`, `pptx`, `rtf`, `html`, `htm`, `csv`, `tsv`, `txt`, `md`, `markdown`, `jpg`, `jpeg`, `png`, `gif`, `bmp`, `tif`, `tiff`, `webp`

</Collapsible>
