Skip to main content
A file is any document or image stored on an agent:
  • A document uploaded with multipart POST/v2/agents//threads//observe (PDF, Office, OpenDocument, Markdown, CSV, plain text, code, or an image read as a one-page document).
  • A picture cut from a document (carries parent_file_id pointing to its parent document).
  • An image sent in files on observe-and-respond or respond for the agent to inspect while answering.
Files belong to the agent. Once a document reaches committed, every thread of the agent can retrieve memories from it and cite it.

List, inspect, and download files

Understanding upload status fields

When a document finished cleanly, memory_state is learned and the unfinished fields are null. When something is still running or stopped partway, File reports:

Resume a stopped upload or unread pictures

If an upload stopped partway (upload_state is partial or failed), Priors keeps the stored file. Call POST/v2/agents//files//resume to finish learning only the remaining pieces without re-uploading or paying for pieces already learned:
Success: status 202 with the updated File object and a Location header pointing to GET/v2/agents//files/. Poll GET…/files/ until upload_state clears and memory_state is learned. Optional request fields:
  • {"only": "pictures"}: when a document’s text finished learning but figures_unread > 0 and figures_retry is available, re-reads only the unread figures (charging only for the newly read figure descriptions).
  • {"thread_id": "thread_01J..."}: when you cannot open the original thread (can_finish: false), reads the full file again in the specified thread (charged in full).
Errors: 409 conflict (nothing to resume or caller cannot open the upload thread), 409 duplicate_upload_in_progress (already running), 413 (exceeds current document limits), 429 rate_limit_exceeded.

Delete a file and its memories

Call DELETE/v2/agents//files/ as the agent’s owner:
Success: status 202 with no body and a Location header pointing to GET/v2/agents//memories?file_id=. What happens immediately vs in the background:
  1. Before 202 returns: Priors deletes the file bytes, any pictures cut from it, and its upload ledger rows. The file disappears from GET…/files and returns 404 on download.
  2. In the background: a deletion job erases the file’s pieces and deletes every memory made from any turn citing that file. Poll the Location URL until every turn listed there has state: "forgotten".

Errors on DELETE /v2/agents/{agent_id}/files/{file_id}

Deleting a file forgets every turn that cites that file, but it does not touch unrelated chat turns where a user manually pasted or paraphrased text from the document. See C2. Remove a document and B4. A policy changes.

Citations on answers

observe-and-respond and respond return a citations list naming the files the answer drew on:
  • href downloads the file using your same bearer token.
  • verified is true when the answering model looked directly at an attached image on that turn, and false when the answer drew on memories learned earlier from a document (the normal case for PDFs and handbooks).

Attaching images to answering calls

In v2, you do not need a separate upload endpoint to show an image to the agent while answering. Pass images directly in the files array of observe-and-respond or respond:
  • New image: {"type": "image", "data": "<base64>", "media_type": "image/png", "filename": "error.png"}
  • Existing image on this agent: {"type": "image", "file_id": "img_9f2c4e7a1b3d5f8091a2b3c4d5e6f708"}
Up to 10 images per message, 10 MiB per image (PNG, JPEG, or WebP), up to 20 MiB total base64 image payload per v2 request. To teach an agent the text inside a screenshot or receipt as a permanent document, upload it with multipart observe instead.