Request
integer
required
The state version of the session that this event applies to. Use the
state_version from your most recent response.object
required
The event to process. It has a
kind that selects one of the shapes below.Response
object
The form to render after the event was applied. See the form
reference.
integer
The new state version of the session. Use it for your next request.
Concurrency
A session handles one event at a time, and every event names the state version it was based on. This keeps two clients, or a client and a retry, from overwriting each other. If a request fails after you sent it and you cannot tell whether it was applied, send it again with the samestate_version: if it was
applied the session has moved on, and you get stale_state with the current
form instead of a second application.
Errors
The session no longer exists.
Another request for this session is in progress. Wait briefly and retry the
same event.
The
state_version did not match the session’s current version. The error
includes the current form and state_version. Use those rather than
retrying blindly, since the field or action you intended may no longer apply.The session has expired. This is terminal.
Example
Request
Response
Stale state