- 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_idpointing to its parent document). - An image sent in
filesonobserve-and-respondorrespondfor the agent to inspect while answering.
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:
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 butfigures_unread > 0andfigures_retryisavailable, 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).
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:
202 with no body and a Location header pointing to GET/v2/agents//memories?file_id=.
What happens immediately vs in the background:
- Before
202returns: Priors deletes the file bytes, any pictures cut from it, and its upload ledger rows. The file disappears from GET…/filesand returns404on download. - In the background: a deletion job erases the file’s pieces and deletes every memory made from any turn citing that file. Poll the
LocationURL until every turn listed there hasstate: "forgotten".
Errors on DELETE /v2/agents/{agent_id}/files/{file_id}
Citations on answers
observe-and-respond and respond return a citations list naming the files the answer drew on:
hrefdownloads the file using your same bearer token.verifiedistruewhen the answering model looked directly at an attached image on that turn, andfalsewhen 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 thefiles 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"}
observe instead.