# Get the access sample

> 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.

Source: https://esigncomply.com/docs/api/sessions/get-the-access-sample

Last updated November 26, 2026

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](https://esigncomply.com/docs/sdk/browser.md) 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`](https://esigncomply.com/docs/api/errors.md#insufficient_permission).

## Request example

### cURL

```bash
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`](https://esigncomply.com/docs/sdk/browser.md) 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](https://esigncomply.com/docs/guides/consumer-econsent.md).

`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](https://esigncomply.com/docs/api.md).

## Response

`200 OK` with an AccessSample object.

```json
{
  "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`](https://esigncomply.com/docs/api/errors.md#not_found) | 404 | No object with that ID exists in this domain and environment. |
| [`session_not_active`](https://esigncomply.com/docs/api/errors.md#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`](https://esigncomply.com/docs/api/errors.md#missing_api_key), [`invalid_api_key`](https://esigncomply.com/docs/api/errors.md#invalid_api_key), [`client_token_expired`](https://esigncomply.com/docs/api/errors.md#client_token_expired), [`domain_mismatch`](https://esigncomply.com/docs/api/errors.md#domain_mismatch), [`insufficient_permission`](https://esigncomply.com/docs/api/errors.md#insufficient_permission), [`rate_limit_exceeded`](https://esigncomply.com/docs/api/errors.md#rate_limit_exceeded) and [`internal_error`](https://esigncomply.com/docs/api/errors.md#internal_error).

Every error has the same body: `error.type`, `error.code`, `error.message`, `error.doc_url` and `error.request_id`. See [Errors](https://esigncomply.com/docs/api/errors.md).

## 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.

## Related

- [Sessions](https://esigncomply.com/docs/api/sessions.md): the overview of the resource and all of its operations.
- [Start a verification](https://esigncomply.com/docs/api/sessions/start-a-verification.md): `POST /v1/sessions/{id}/verifications`
- [Confirm a verification](https://esigncomply.com/docs/api/sessions/confirm-a-verification.md): `POST /v1/sessions/{id}/verifications/{ver_id}/confirm`
- [Complete a session](https://esigncomply.com/docs/api/sessions/complete-a-session.md): `POST /v1/sessions/{id}/complete`
- [Cancel a session](https://esigncomply.com/docs/api/sessions/cancel-a-session.md): `POST /v1/sessions/{id}/cancel`
- [Quickstart](https://esigncomply.com/docs/quickstart.md)
- [Browser SDK](https://esigncomply.com/docs/sdk/browser.md)
- [Errors](https://esigncomply.com/docs/api/errors.md): every error code, with what to do.
- [API conventions](https://esigncomply.com/docs/api.md): authentication, idempotency, rate limits and versioning.
