Skip to main content

Example use case

You retire an older product line on the inbound support line and must remove its manual, or a prospect asks you to delete a confidential proposal uploaded to their sales agent.

Setup

Call DELETE/v2/agents//files/ as the agent’s owner:
  • Immediate removal: before returning 202, Priors deletes the file bytes, any extracted pictures cut from it, and its upload ledger rows.
  • Background memory cleanup: Priors starts a job that erases the file’s pieces and forgets every memory from turns citing the file.
  • Verify completion: poll the returned Location header (GET/v2/agents//memories?file_id=) until every listed turn reaches forgotten.

Benefit with Priors

  • One-call cleanup: removes original file bytes, extracted figures, upload metadata, and learned memories together.
  • Safe across large documents: avoids looping through thousands of individual file pieces (and DELETE…/memories/ deliberately directs file pieces here).

What goes wrong

DELETE/v2/agents//files/ returns 409 conflict if the file is still learning or waiting in the upload queue, or if you pass the file_id of an extracted picture instead of the parent document. Memories made from ordinary chat turns that did not cite the file also remain if someone pasted excerpts into conversation.

Recommendation

Wait until ingestion finishes before deleting a file, always delete using the parent document’s file_id, and poll the Location URL until every citing turn reads forgotten. Forget any manual chat excerpts separately if needed.

Calls used