CEEJAYDocs

Confirm connect

Confirm the connection from the game's side after the player has seen which Discord account approved it, or end the session.

POST /v1/connect/confirm · for public key

A connection is saved only after the Discord member and the game have both confirmed. This is the game's half: show the player the Discord name that Get the result returned, and send the player's decision.

Body parameters

Prop

Type

Returns

What Get the result would return next: after a confirmation for a session the game started, the approved result with the member summary, a player session and a refresh token.

Example

Request
curl -X POST https://ceejay.communitystudios.xyz/api/v1/connect/confirm \
  -H "Authorization: Bearer $CEEJAY_PUBLIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sessionSecret": "ceejay_cs_4f8a2c1e9b7d3e41f8a6b0c1d25f0c2a9b7d3e41f8a6b0c1d24f8a2c1e9b7d3e",
    "accept": true
  }'

The TypeScript tab calls connect.confirm of the Connect client in the TypeScript SDK. Leave the session out to confirm the one connect.start opened. connect.cancel ends the open session by declining it.

200 OK
{
  "success": true,
  "data": {
    "status": "approved",
    "connection": {
      "connectionId": "8841",
      "game": "rugby_manager",
      "playerId": "p_19",
      "proof": "verified",
      "connectedAt": "2026-10-08T18:06:40.000Z",
      "moved": false,
      "alreadyConnected": false,
      "spendHoldUntil": "2026-10-09T18:06:40.000Z"
    },
    "member": {
      "displayName": "Nova",
      "nickname": "Nova | EU",
      "avatarUrl": "https://cdn.discordapp.com/avatars/409876543210987654/a1b2c3d4e5f60718293a4b5c6d7e8f90.png",
      "level": 12,
      "xp": 5420,
      "coins": 1450,
      "roles": [
        {
          "id": "982371004827100394",
          "name": "Tournament winner"
        }
      ],
      "membership": "member",
      "joinUrl": null
    },
    "join": {
      "asked": false,
      "result": "not_asked",
      "failure": null
    },
    "sharing": {
      "agreed": [
        "progress",
        "activity"
      ],
      "needed": []
    },
    "reward": {
      "status": "pending",
      "items": []
    },
    "manageUrl": "https://ceejay.communitystudios.xyz/connect/mine",
    "playerSession": {
      "token": "cjps1.eyJ2IjoxLCJhdWQiOiJnYW1lIiwicyI6IjcyMTEwNDkzODI3MTAwMzg0MiIsImciOjEyfQ.pV3mQ0b6k1y8ZtL2c9XwR4s7Nf5aHj0uEoGdBiKq3M",
      "expiresAt": "2026-10-08T18:21:44.000Z"
    },
    "refreshToken": "ceejay_rt_5512.1.4f8a2c1e9b7d3e41f8a6b0c1d25f0c2a9b7d3e41f8a6b0c1d24f8a2c1e9b7d3e",
    "refreshExpiresAt": "2027-01-06T18:06:44.000Z"
  }
}
200 OK, after declining
{
  "success": true,
  "data": {
    "status": "cancelled",
    "reason": "game_declined"
  }
}

Why the game is asked

A link, a QR image or a code can be seen by someone else: on a stream, on a shared screen, on a console in a living room. Whoever opens it can approve with their own Discord account. The game then shows that account's name to the player, who sees that it was not them and declines. Nothing has been saved by then.

So there is no default. Ask the player every time, with the name and the avatar.

What accepting and declining do

accept: true is accepted only while the session's status is needs_game_confirmation.

  • For a session the game or your server started, the member has approved by then: the session is finished, the connection is saved, and the response is the approved result.
  • For a session a member started in Discord, the status becomes needs_confirmation and the member confirms there. Keep polling for the result.

accept: false ends an open session in any state. Its status becomes cancelled and its reason game_declined.

Retrying safely

The request is safe to repeat. Confirming twice returns the same result as the first time. Declining a session that has ended changes nothing and returns the session as it is.

Errors

StatuscodeerrorWhen
400bad_requestThe request body must be a JSON objectThe body is null, text, a number or a list. A request with no Content-Type header is read as text, so it gets this response too
401invalid_session_secretInvalid session secretsessionSecret is missing, is not a session secret, or is not the secret of a session of this game. A secret of another game's session is unknown here
400bad_requestaccept must be true or falseaccept is missing or is not true or false
404session_not_foundConnect session not foundThe session could not be read again. Start again
409nothing_to_confirmThere is nothing to confirm on this request right nowaccept is true and the session is not waiting for the game's confirmation: the member has not approved, or the session has ended
409session_changedThis request changed since it was shown. Read it againThe session changed between the member's approval and this request: another account connected this player, or the member connected another player. Read the session again. When it has ended, start a new one, and the member is shown what changed
409player_blockedThis player cannot be connected until the community lifts a blockThe community blocked this player. The session has ended
409player_takenThis player is connected to another Discord account. Connect from the game the player is signed in toThe player is connected to another Discord account and cannot be moved to this one: that connection is verified and this one is not. The session has ended
410result_goneThe result of this request can no longer be read. Start againThe confirmation was accepted, but the result can no longer be read: what the session approved has changed since. Start again

The secret is checked before accept.

Every error body also carries requestId, and a 400 with the code bad_request names the invalid field in field. Match on code, not on the message text, which can change.

The errors every request of a game shares (the key, the state of the game, the origin, 405, 429, 500) are on the Errors page.

On this page

Community StudiosPrivacyTerms