Log In

Unarchive a Document

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

Clears the Document's archived state and returns it with archived_at empty. Refuses with a 409 when the Document is not archived.

A Document on a participant record is the exception to that 409: a current one answers 403 rather than 409, because the archive rule that refuses to archive a participant record's Document on its own gates this endpoint too, and it refuses before the archived state is read. Read archived_at first for this owner type rather than reading 403 as "unsupported".

A Document is only unarchivable 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 or a participant information item's attachment answers 403. Neither can one whose participant record is itself archived: that record archived its Documents with it, and unarchiving the record is what brings them back together. A Document archived on its own while its record is current — as a document import leaves it — is unarchived here, which puts it back in step with the record. Archiving a participant record's Document individually is refused either way: that is the record's own archive to make.

  • 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 and is not archived.
  • 404Not found
  • 409The Document is not archived, or its participant record is archived too.