Skip to navigation

Expire a session

Ends a live session early. The link stops working at once, anything the applicant entered is discarded, and your endpoints receive session.expired. Safe to repeat: a session that had already ended returns changed: false.

Error codes

errorStatusMeaning
session_not_found404No session with that id for this organisation and environment.
session_already_submitted409The applicant has submitted, so there is nothing left to expire.
Missing or invalid Authorization header401No bearer credential was sent.
Invalid API key401The key is unknown or revoked.
environment_mismatch403The key belongs to an environment this host does not serve.
origin_not_allowed403The request origin is not on the publishable key allowlist.
ip_not_allowed403The caller address is not on the secret key allowlist.
organization_suspended403The organisation is suspended.
secret_key_required403A publishable key was used on a secret-key endpoint.

Requires a secret (sk_) key. A publishable key receives 403 secret_key_required.

Authentication

AuthorizationBearer
Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required.

Path parameters

sessionIdstringRequired
The session identifier.

Response

The session has ended.
sessionIdstring
The session identifier.
statusenum
How the session ended.
Allowed values:
changedboolean
False when the session had already ended.
expiresAtdatetime
When the session ended.

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error