Skip to main content
GET
/
game-sessions
List game sessions
curl --request GET \
  --url https://api.spikelabs.com/v1/game-sessions \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "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"
    }
  ],
  "has_more": true,
  "next_cursor": "<string>"
}

Authorizations

Authorization
string
header
required

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

Query Parameters

user_id
string
game_id
string
status
enum<string>
Available options:
waiting,
active,
completed,
abandoned
limit
integer
default:20

Number of items to return (1-100)

Required range: 1 <= x <= 100
cursor
string

Pagination cursor from previous response

Response

200 - application/json

List of game sessions

data
object[]
required
has_more
boolean
required
next_cursor
string | null