Skip to content
DocsMenu

How long does a session last?

View as Markdown

Open this page inChatGPTClaudeCursor

A session lasts 30 minutes by default. Set expires_in on POST /v1/sessions to any whole number of seconds from 60 to 86,400, which is 24 hours. Esign Comply expires the client token at the same moment. After that, browser calls on the session return 401 client_token_expired and you create a new session.

How do I set a different session lifetime?

Send expires_in, in seconds, when you create the session. The default is 1,800 seconds. A value under 60 or over 86,400 returns 400 invalid_request with param: "expires_in". The response carries expires_at, the exact time the session ends.

curl https://esigncomply.com/v1/sessions \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: signup-user_7c1d-1" \
  -d '{
    "profile": "prof_signup_4f1a",
    "signer": { "external_id": "user_7c1d" },
    "documents": [{ "document": "doc_8Hq2", "version": "current" }],
    "context": { "url": "http://localhost:3000/signup" },
    "expires_in": 3600
  }'

What happens when a session expires?

The session moves to expired, which is a final state, and the session.expired webhook is sent. Events and completion sent with the client token return 401 client_token_expired. No record is written, so an expired session is not a signature event. A job expires overdue sessions every minute, and reading one with GET /v1/sessions/{id} marks it expired at once.

Can I extend a session that is already running?

No. expires_at is fixed when the session is created, and no call changes it. For a signer who needs longer, create the session with a longer expires_in, up to 86,400 seconds.

How do I start again after a session expired?

Create a new session on your server and attach the browser SDK with the new client_token. Use a new Idempotency-Key: the old key replays the response of the expired session. Create the session when the form is shown, not when the page first loads in a background tab.

Last updated · API version 2026-11-21