/state-validationstate validation
#state-validationValidates the CSRF state token and cookie to ensure the authorization flow has not been tampered with. This endpoint is called after a redirect from an OAuth-style authorization flow to verify that the state matches the session cookie.
Purpose
- Prevents CSRF attacks in OAuth-like flows
- Verifies that the client initiating the flow is the same as the one completing it
- Returns session metadata including click timestamp, user agent, and IP address
Flow
- Client initiates link access and receives a state parameter
- After redirect, client calls this endpoint with the state, clientId, and alias
- Server validates the state matches the stored session cookie
- Returns validation result with session information
Usage
- Typically called by client applications implementing OAuth code flow
- Used with JWT links that have
flow: codeconfiguration
Parameters
statequeryrequiredCSRF protection token (UUID v4 format) that was issued when the link was first accessed. This value must match the session cookie to prevent CSRF attacks.
string / uuid
clientIdqueryrequiredClient application identifier (UUID v4) that is requesting validation. Must match the clientId associated with the link.
string / uuid
aliasqueryrequiredThe unique identifier (alias) of the link being validated. This is the base64-encoded value returned when the link was created.
string
Responses
200application/jsonState validation completed. Returns the validation result and session metadata.
object
cookieValidationrequiredstringThe result of the cookie validation. Returns
VALIDif the state token matches the session cookie, indicating the request came from the same browser session that initiated the flow. ReturnsINVALIDif there is a mismatch, which may indicate a CSRF attack or expired session.clickedAtrequiredstring / date-timeISO 8601 timestamp indicating when the link was originally clicked. This helps track the elapsed time between the initial click and the validation request.
userAgentrequiredstringThe User-Agent string from the browser that originally clicked the link. This information can be used for analytics, device fingerprinting, or detecting potential fraud.
ipAddressrequiredstring / ipv4The IP address from which the link was originally clicked. This can be used for geolocation, fraud detection, or comparing with the current request's IP address.
400application/jsonInvalid request. One or more parameters do not match the required format or validation failed.
object
errorCoderequiredstringA stable, machine-readable error code that identifies the specific type of error. Use this for programmatic error handling.
errorMessagerequiredstringA human-readable message that describes the error. This message may contain additional context about what went wrong and how to fix it.
correlationIdrequiredstring / uuidA unique identifier (UUID) for this request that can be used to trace the error in server logs. Include this ID when contacting support. This value matches the X-Correlation-Id response header.
401application/jsonUnauthorized. The state token does not match the session cookie or has expired.
object
errorCoderequiredstringA stable, machine-readable error code that identifies the specific type of error. Use this for programmatic error handling.
errorMessagerequiredstringA human-readable message that describes the error. This message may contain additional context about what went wrong and how to fix it.
correlationIdrequiredstring / uuidA unique identifier (UUID) for this request that can be used to trace the error in server logs. Include this ID when contacting support. This value matches the X-Correlation-Id response header.
404application/jsonNot found. The specified alias or session does not exist.
object
errorCoderequiredstringA stable, machine-readable error code that identifies the specific type of error. Use this for programmatic error handling.
errorMessagerequiredstringA human-readable message that describes the error. This message may contain additional context about what went wrong and how to fix it.
correlationIdrequiredstring / uuidA unique identifier (UUID) for this request that can be used to trace the error in server logs. Include this ID when contacting support. This value matches the X-Correlation-Id response header.
500application/jsonInternal server error. An unexpected error occurred while processing the request.
object
errorCoderequiredstringA stable, machine-readable error code that identifies the specific type of error. Use this for programmatic error handling.
errorMessagerequiredstringA human-readable message that describes the error. This message may contain additional context about what went wrong and how to fix it.
correlationIdrequiredstring / uuidA unique identifier (UUID) for this request that can be used to trace the error in server logs. Include this ID when contacting support. This value matches the X-Correlation-Id response header.