Skip to main content
GET
/
game-sessions
/
{session_id}
Get game session
curl --request GET \
  --url https://api.spikelabs.com/v1/game-sessions/{session_id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "gs_abc123",
  "object": "game_session",
  "game_id": "<string>",
  "personality_id": "<string>",
  "status": "waiting",
  "created_at": "2023-11-07T05:31:56Z",
  "user_id": "<string>",
  "current_turn": "user",
  "state": {},
  "winner": "user",
  "move_count": 123,
  "personality_commentary": "<string>",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Use your secret key (starts with sk_) as a Bearer token.

Path Parameters

session_id
string
required

Response

Game session details

id
string
required
Example:

"gs_abc123"

object
enum<string>
required
Available options:
game_session
game_id
string
required
personality_id
string
required
status
enum<string>
required
Available options:
waiting,
active,
completed,
abandoned
created_at
string<date-time>
required
user_id
string | null
current_turn
enum<string>
Available options:
user,
personality
state
object

Game-specific state

winner
enum<string> | null
Available options:
user,
personality,
draw
move_count
integer
personality_commentary
string | null

Personality's latest comment

updated_at
string<date-time>