Menu

Sessions

session.close

Closes one session.

Who calls it

You → usPOST /v1/session.close

Call it when the player logs out or leaves. Sign the call with your API key. See Authentication.

Request

FieldTypeWhat it is
requestIdstringYour id for this change. Send it again after a timeout and you get the first answer back.
firstSentAtstring, UTC timeWhen you first sent this request. It stays the same on every retry. A request older than 7 days is refused.
sessionIdstringWhich session.
reasonstringYour own text, for example logout. Both sides can later see why it closed.

Answer

ok, with the session as it is. Closing a session that is already closed is not an error. The answer says who closed it first and why. A close that crossed our own close must not look like a failure.

After a close

Errors

CodeWhenYour next step
session_not_foundNo session with this sessionId in this environment.Check the id and the Environment header.
invalid_requestA field is missing or wrong, for example a firstSentAt more than 5 minutes in the future. message names the field.Fix the call. Sending it again unchanged fails again.
request_expiredfirstSentAt is older than 7 days. Nothing is done.A bug or a stuck job on your side. Look up the result with session.get or round.get.
duplicate_mismatchA requestId we have seen comes with a different body.A bug on your side: each new change needs a new id.

Every call can also return the codes that guard all calls. See Error codes. This call never counts against your rate limits.

Example

POST /v1/session.closeExample
Request
{
  "requestId": "rq-77190",
  "firstSentAt": "2026-10-31T09:40:00Z",
  "sessionId": "s-01JC8Z…",
  "reason": "logout"
}

Answer
{ "ok": true, … }