Documents

Document lifecycle and identifiers

The records behind documents, versions, operations and events, and which IDs to keep.

Records

RecordCreated whenChanges later?
DocumentPOST /api/v2/documents stores the fileKeeps one identity in its organisation, workspace and environment
VersionAn upload or a completed operation stores contentNever: versions are immutable
OperationPOST /api/v2/document-operations is acceptedUntil it is completed, failed or cancelled
Access decisionA protected action is checkedNever: kept as a record of the decision
EventSomething changes, such as an operation completingNever: delivered as a signed webhook to subscribed endpoints

Keep your own mapping

Store the public IDs Wellfriend returns and map them to your own records; your own record stays the source of truth for your business. An ID alone never grants access: every read stays inside the key's organisation, workspace and environment.

Rules for each state

  • Do not process or share a document until the upload has returned its version.
  • Do not treat a 202 response as success.
  • Do not try to replace a version in place.
  • Do not reuse a revoked link or an expired session.
  • Keep failed and cancelled as separate states in your own database.

Features use exact versions

Secure links, viewer sessions, annotations, forms, analytics and automations refer to a document and, where the content matters, an exact version. A later upload therefore never changes what a recipient saw or reviewed.