# Sessions & launch > Creating a session, opening the launch URL, session lifecycle, closing early, and reading what a player has in play. Source: https://casinoapipro.com/docs/sessions A session binds one player to one game for one sitting, and produces the launch URL you open in their browser. It is the only object you need to create in order to start play. ## Create a session `POST /v1/sessions` — auth: operator-api **Body** | Name | Type | Required | Description | | --- | --- | --- | --- | | `game_id` | string | yes | The game's slug (`"mines"`) or id. Slugs are stable and easier to read in logs. | | `player_id` | string | yes | Your identifier for the player. Opaque to us, scoped to your account. | | `currency` | string | yes | ISO 4217, e.g. `"GHS"`. Must be enabled for both your account and the game. | | `ttl_seconds` | integer | no | Shorten the session lifetime. Cannot exceed your account default. | | `brand_id` | string | no | Which of your brands this sitting belongs to, if you run more than one. | | `player_name` | string | no | Display name shown in multiplayer games, 1–40 characters. Never used for identity, and never matched against anything. Sent on any session it replaces the stored name; omitted, the stored one is kept. | | `return_url` | string | no | Where the launcher sends the player when they close the game. | > **A name you send is shown as you sent it** > > A player who arrives without `player_name` appears as their `player_id` with all but the first and last character masked — safe, and unreadable. A name you supply is shown verbatim instead, because you chose it for this purpose: we do not mask it again, so `"***417"` stays `"***417"` rather than becoming `"***7"`. Send a username or a handle you are happy for other players to see — never a phone number or anything a player signs in with. _cURL_ ```bash curl -X POST https://api.casinoapipro.com/v1/sessions \\ -H "Authorization: Bearer $ACCESS_TOKEN" \\ -H "Content-Type: application/json" \\ -d '{ "game_id": "mines", "player_id": "your_player_42", "currency": "GHS", "return_url": "https://your-casino.com/lobby" }' ``` _JavaScript_ ```js const session = await api.post("/v1/sessions", { game_id: "mines", player_id: player.id, currency: player.currency, return_url: "https://your-casino.com/lobby", }); res.redirect(session.launch_url); ``` _PHP_ ```php $session = $client->post("/v1/sessions", [ "game_id" => "mines", "player_id" => $player->id, "currency" => $player->currency, "return_url" => "https://your-casino.com/lobby", ]); header("Location: " . $session["launch_url"]); ``` ```json { "session_id": "sess_kgv5ws4duteqwhvjobok", "launch_url": "https://games.casinoapipro.com/play?token=eyJhbGciOi…", "expires_at": "2026-08-29T19:11:56.237Z", "game": { "id": "d533d22e…", "slug": "mines", "name": "Mines" }, "player_id": "your_player_42", "currency": "GHS" } ``` ## Opening the launch URL Redirect to it, or embed it in an `