Skip to content
DocsMenu

Get the access sample

View as Markdown

Open this page inChatGPTClaudeCursor

In the Esign Comply API, GET /v1/sessions/{id}/access-sample serves the sample document for the access demonstration in the consumer consent flow, with a six-digit code inside. The browser SDK calls it with the client token before the signer opens the sample and types the code back.

GET /v1/sessions/{id}/access-sample · API version 2026-11-21

Authentication

Send the client token of the session (esc_ct_...) in the Authorization header: Bearer $CLIENT_TOKEN. The browser SDK sends it for you. A client token works for its own session only. In live mode the call must come from a page inside the registered domain; in test mode from localhost, 127.0.0.1, the registered domain or a listed preview host. A secret key is refused with insufficient_permission.

Request example

cURL

curl https://esigncomply.com/v1/sessions/ses_awnY/access-sample \
  -H "Authorization: Bearer $CLIENT_TOKEN"

The Node SDK does not make this call. In a browser, @esigncomply/browser makes it with the client token.

This request ran against the API on November 26, 2026, and the response below is what came back. IDs are example values, and long values are shortened with ....

What it does

Returns the sample document for the access demonstration in the consumer consent flow: a short document in the delivery format, containing a six-digit code. The signer opens it and types the code back, which is then sent as an access.demonstrated event. The code is generated once per session. See the consumer consent guide.

format is pdf when any document in the session is a PDF, otherwise html.

Parameters

Name In Type Required Description
id path string Yes ID of the session.

Headers: Esign-Comply-Version (optional, a dated API version). See API conventions.

Response

200 OK with an AccessSample object.

{
  "object": "access_sample",
  "session_id": "ses_awnY",
  "format": "html",
  "instruction": "To confirm you can open the records we will send, open this sample and enter the code shown inside it.",
  "html": "<article data-esc-access-sample><h1>Sample record</h1><p>This sample is in the same format as the records you will receive electronically.</p><p>Your access code is <strong>838067</strong>.</p></article>"
}

Response fields

Field Type Description
object string
session_id string
format string
instruction string
html string

Errors

Code HTTP When
not_found 404 No object with that ID exists in this domain and environment.
session_not_active 409 The session is completed or cancelled, so it accepts no more events, verifications, completion or cancel.

Like every call made with a client token, it can also return missing_api_key, invalid_api_key, client_token_expired, domain_mismatch, insufficient_permission, rate_limit_exceeded and internal_error.

Every error has the same body: error.type, error.code, error.message, error.doc_url and error.request_id. See Errors.

Questions about GET /v1/sessions/{id}/access-sample

Which credential does GET /v1/sessions/{id}/access-sample need?

The client token of the session, which starts with esc_ct_. The browser SDK sends it as a Bearer token in the Authorization header. A secret key is refused with insufficient_permission.

Does GET /v1/sessions/{id}/access-sample work with a test key?

Yes. It works in test mode and in live mode. The mode is the mode of the key that created the session.

Does GET /v1/sessions/{id}/access-sample count as a signature event?

No. A signature event is counted when a live record is written, by completing a session or by submitting a deferred acceptance. This call writes no record.

Is GET /v1/sessions/{id}/access-sample idempotent?

It is a read, so it is safe to repeat. It takes no Idempotency-Key header.

What is the rate limit for GET /v1/sessions/{id}/access-sample?

240 calls per minute for each session. Past the limit the API answers 429 rate_limit_exceeded with a Retry-After header.

Does the Node SDK have a method for GET /v1/sessions/{id}/access-sample?

No. The browser SDK, @esigncomply/browser, makes this call for you with the client token of the session.

Last updated · API version 2026-11-21