documents

Get Document Session

Resolve a document to its signing session.

Exists for the pre-details-page email links: owner-facing viewed/ declined/completion emails sent before the dashboard_url fix deep-linked to /documents/{document_id}/view -- a frontend route keyed on the DOCUMENT id. The live envelope page is keyed on the SIGNING SESSION id (/documents/:sessionId/details), so the /documents/:documentId/view shim needs this lookup to redirect the old links. An id baked into an already sent email can never be edited; only the route can change.

A document can back more than one session (a re-sent voided envelope creates a new session on the same document row -- see send_response_for_document). The NEWEST session answers "how is my send doing": viewed/declined emails are status notifications, and the only safe answer is the attempt currently in flight. When an earlier session already completed, its id rides along as completed_session_id so the details page can link to the signed copy -- the route this replaces served the completed PDF itself (the old DocumentView fetched GET /{document_id}/download), so a completion email must stay one click away from its signed document rather than landing on it silently.

Ownership rides on SigningSession.org_id directly, not _owned_document: a session can outlive its Document row (the ledger outerjoins Document for exactly that case, see _base_query), and gating on the document row would 404 an envelope the caller still owns and can see listed. The org filter spans every org the caller can switch to, not just the active one -- a sender who changed teams since sending still owns the envelope; the response carries the session's org_id so the shim can run the same switch-team flow as the team menu before landing.

get/api/documents/{document_id}/session

Request

  • Base URL: https://zsign.io (the document declares no server; this is the origin it was published from)
  • URL: https://zsign.io/api/documents/{document_id}/session
  • Auth: HTTP bearer

Path parameters

document_idstring uuid required

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.