Menu

Sessions

session.closed

Tells your server that a session closed, who closed it, and why.

Who calls it

We → youPOST {your server}/v1/session.closed

A session can close on our side without you asking: the player pressed exit, was idle, or started a new session. You must know, or your session stays open. We sign the call with our private key. Check it with our public key for the environment. See Signing calls.

Request

FieldTypeWhat it is
eventIdstringWe send the event again until you accept it. Ignore an eventId you have seen.
sessionIdstringWhich session.
casinoSessionIdstringWhich session on your side.
playerIdstringWhose session.
closedBystringcasino, player or system.
reasonstringWhy it closed. See the table below.
startedAtstring, UTC timeWhen the session started.
openedAtstring, UTC timeWhen the game link was first opened. Empty for not_opened.
closedAtstring, UTC timeWhen it closed.
openRoundIdstring, optionalOnly if a Mines round is still open. A bet is still waiting for its result.

Answer

Answer ok to accept the event. This is the only event. There is no round event: you learn each round’s end from wallet.win or wallet.loss.

Who closes, and why

A session has two states: active and closed. A closed session never opens again.

Closed byreasonWhen
casinoyour own text, e.g. logoutYou call session.close.
playerexitThe player pressed exit in the game.
systemnot_openedThe game link was not opened within 2 minutes.
systemidleNo player action for 30 minutes. This also covers a closed page, which tells us nothing.
systemreplacedYou allow one session per player, and the player started a new one.
systemenvironment_deletedYou deleted the Sandbox environment.

Errors

No error codes are defined for your answer. If you do not accept the event, we send it again with the same eventId.

Example

POST {your server}/v1/session.closedExample
Request
{
  "eventId": "e-01JC9A…",
  "sessionId": "s-01JC8Z…",
  "casinoSessionId": "c-5531",
  "playerId": "p-82731",
  "closedBy": "system",
  "reason": "idle",
  "startedAt": "2026-10-31T09:02:11Z",
  "openedAt": "2026-10-31T09:02:13Z",
  "closedAt": "2026-10-31T09:47:30Z",
  "openRoundId": "r-01JC90…"
}

Answer
{ "ok": true }