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 or upload a document, then connect it to the agents that need it. Each file is stored and processed once in the workspace.
Quick example
# 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" 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 What you need to know
- They apply live: connecting, pausing or scheduling or editing 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 opens a processing (uploadId) that goes throughawaiting_upload->queued->parsing->chunking->embedding->readyorfailed. If you create it withattachment.agentId, the connection starts paused and activates by itself when it reachesready(activateOnReady: true). While a replacement is processing, agents keep using the previous version. - AI-generated names: if you omit
titleordescription, Platica generates them automatically when it finishes processing the content (you can also ask for a proposal without saving with Suggest metadata). - Up-to-date pages: a
urlfile can re-read itself every6,12,24,48,72,168,336or720hours (refresh.intervalHours).
Endpoints
| Method | Endpoint | What it does |
|---|---|---|
GET | /v1/files | List the workspace's files |
POST | /v1/files | Create from text, a web page or a document (up to 1 MiB) |
POST | /v1/files/upload | Open an upload session for a document (1 to 50 MiB) |
GET | /v1/files/{fileId} | Get metadata, text (content), download or affectedAgents |
PATCH | /v1/files/{fileId} | Change title, description, refresh or replace content |
POST | /v1/files/{fileId}/reprocess | Re-read the page or the original file |
POST | /v1/files/{fileId}/metadata/suggestion | Suggest a title and description with AI without saving |
DELETE | /v1/files/{fileId} | Delete from the workspace and from all agents |
GET | /v1/files/{fileId}/jobs/{uploadId} | Read a processing's state |
To connect, pause, schedule or disconnect files of a specific agent, go to Agent files.
The error codes (FILE_JOB_IN_PROGRESS, FILE_NOT_READY, STORAGE_LIMIT_EXCEEDED, QUOTA_EXCEEDED, CONFLICT) are in Errors and the tools for AI assistants are in the Files MCP tools.
Document formats
pdf, doc, docx, xls, xlsx, ppt, pptx, rtf, html, htm, csv, tsv, txt, md, markdown, jpg, jpeg, png, gif, bmp, tif, tiff, webp