Skip to main content
DELETE /v1/game/session/end Call when a player leaves the game. Stops billing and cleans up the session.

Request

Headers

string
required
Per-game API Key.
string
required
application/json

Body

string
required
Game session ID to terminate.
integer
Client-measured play time (seconds). Optional — for comparison with the server-side value.

Response

Success — 200

string
required
Always "SUCCESS".
integer
required
Server-side play time (seconds) — this is the authoritative value used for settlement.
integer | null
The play_duration_sec value sent in the request. null if not provided.

Errors

404 and 409 errors mean the session is already cleaned up — safe to ignore. Just log and continue normal flow.

Luau example

When to call

PlayerRemoving

Call when an individual player leaves.

BindToClose

Clean up all active sessions on server shutdown.
BindToClose has a 30-second time limit. Even if HTTP calls fail, sessions are automatically cleaned up via expiration after 4 minutes.