Documents

Hosted viewer sessions

Create, use, refresh and end a viewer session for one document version.

Creating a session

A recipient starts a viewer session by opening a Secure Link and passing its check. For an embedded viewer, your server creates a short-lived embed session with POST /api/v2/embed-sessions (scope embeds.write) for one exact document version and one registered parent origin, reads it with GET /api/v2/embed-sessions/{sessionId} (scope embeds.read), extends it with POST /api/v2/embed-sessions/{sessionId}/refresh and ends it with POST /api/v2/embed-sessions/{sessionId}/revoke. Embed configurations live under /api/v2/embeds (scopes resources.read and resources.write), and engagement is reported through GET /api/v2/documents/{documentId}/analytics.

Manifest and pages

  • Read the manifest for the version, page count, permissions and route templates.
  • Treat page and thumbnail addresses as temporary, not as permanent file locations.
  • Offer search, download, print, forms or annotations only when the manifest allows them.
  • Do not cache private responses longer than the session lasts.

Refreshing

A refresh is a new authorization check. Request it through your backend, handle a refusal as a normal outcome, and replace the session in the browser only after your server returns a new one. Never extend an expiry in the browser.

When a session ends

StateWhat the viewer should do
ExpiredAsk your server to refresh, or show that the session has closed
RevokedStop all requests and show that access has ended
Permissions changedReload the manifest and hide controls that are no longer allowed
Version unavailableDo not quietly show another version
Network failureRetry safe reads a limited number of times; do not treat it as a permission problem