Log In

Archive a Document

post/public/v1/documents/{document}/archive

Records that the Document is no longer current, and returns it with archived_at set. Refuses with a 409 when it is already archived, so the date it was first archived on is never overwritten. Archiving does not remove the Document from the Document lists of the records it is attached to: those lists carry no status filter, so read archived_at to tell an archived Document from a current one.

A Document is only archivable here when every record it is attached to is one these endpoints manage, and a note about a staff member is not one of them, so a staff member's file, a staff note's attachment, a leave certificate, a payment record or a participant information item's attachment answers 403. One attached to a participant record is archived and unarchived with that record rather than on its own.

  • Authorizationstringrequired

    Bearer authentication header of the form Bearer <token>, where <token> is your API key. See How to set up an API key.

  • documentstringrequired

    The document UUID

Response

200application/json

DocumentResource

  • dataobjectrequired
    ▶Show 6 child attributes
    • idstringrequired
      Example:d1c2e3f4-a5b6-47c8-9d0e-1f2a3b4c5d6e
    • namestringrequired
      Example:Service Agreement
    • file_extensionstringrequired
      Example:pdf
    • archived_atstring | nullrequired
      Example:2024-02-01T09:00:00+00:00
    • created_atstringrequired
      Example:2024-01-15T10:30:00+00:00
    • categoriesobject[]required
      ▶Show 2 child attributes
      • idstringrequired
        Example:c4a5b6c7-d8e9-40f1-a2b3-c4d5e6f7a8b9
      • namestringrequired
        Example:Assessments
  • 401Unauthenticated
  • 403The Document is attached to a record these endpoints do not support, it is no longer attached to any record at all, or it belongs to a participant record, whose Documents are archived with the record itself.
  • 404Not found
  • 409The Document is already archived, or it belongs to a participant record and lost a race against that record being unarchived.