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
| State | What the viewer should do |
|---|---|
| Expired | Ask your server to refresh, or show that the session has closed |
| Revoked | Stop all requests and show that access has ended |
| Permissions changed | Reload the manifest and hide controls that are no longer allowed |
| Version unavailable | Do not quietly show another version |
| Network failure | Retry safe reads a limited number of times; do not treat it as a permission problem |