1. API Reference
Chizverse
  • ChizVerse Developer Docs
    • Getting Started
    • API Reference
      • Overview
      • Chizmis Authentication
        • Exchange for a ChizVerse Bearer
        • Hosted Client Login
        • Hosted Client Registration
        • Logout
        • Get Current Account
        • Validate Client Application
        • Login with Existing Session
        • Verify Session Key
      • Activity Tracking
        • Create Launch
        • Create Tracked Session
        • Get Session Checkpoint
        • Get Saved Player Progress
        • Ingest Event Batch
        • Get Game Leaderboard
      • ChizPay Wallet & Transactions
        • Get Wallet by Account ID
        • Transfer Wallet Balance
        • Get Wallet Transaction History
        • Debit Wallet
        • Credit Wallet
        • Get Game Ledger
    • SDK
    • Schemas
      • ExchangeForAChizVerseBearerResponse
      • ExchangeForAChizVerseBearerRequest
      • LogoutResponse
      • LogoutRequest
      • GetCurrentAccountResponse
      • ValidateClientApplicationResponse
      • LoginWithExistingSessionResponse
      • LoginWithExistingSessionRequest
      • VerifySessionKeyResponse
      • CreateLaunchResponse
      • CreateLaunchRequest
      • CreateTrackedSessionResponse
      • CreateTrackedSessionRequest
      • GetSessionCheckpointResponse
      • GetSavedPlayerProgressResponse
      • IngestEventBatchResponse
      • IngestEventBatchRequest
      • GetGameLeaderboardResponse
      • GetWalletByAccountIDResponse
      • TransferWalletBalanceResponse
      • TransferWalletBalanceRequest
      • GetWalletTransactionHistoryResponse
      • DebitWalletResponse
      • DebitWalletRequest
      • CreditWalletResponse
      • CreditWalletRequest
      • GetGameLedgerResponse
  1. API Reference

Activity Tracking API

BASE API : https://api-chizverse.beespokedev.com

Activity Tracking is the canonical gameplay lifecycle API. Create a launch before opening the game, exchange the launchToken for a tracked session, batch gameplay events with the returned sessionKey, and end the session with a final flush. ChizPay game transactions should use the returned sessionId as the gameSession value so wallet ledger rows can be reconciled with gameplay telemetry.

Session Lifecycle

  1. Create Launch with Game Manager.
  2. Open the game URL with chz_launch_token.
  3. Create Tracked Session from the launch token.
  4. Track gameplay events in ordered batches.
  5. Flush queued events during critical transitions.
  6. End Session with game.session.ended.

Endpoints

Create Launch

Creates a tracked game launch and returns the launchToken required for session initialization.

Method & URL

POST /game-manager/v1.0/games/{gameId}/launches

Headers

NameTypeRequiredDescription
authorizationstringYesChizVerse bearer returned by POST /core/public/auth/chizmis. Example: Bearer <token>.

Path Parameters

NameTypeRequiredDescription
gameIdstring | numberYesGame identifier to launch.

Getting gameId

Open the ChizVerse Developer Console and go to the game list. The gameId is the number shown under the game title, for example #27.

Find the Game ID in the Developer Console game list

Request Body

NameTypeRequiredDescription
allowedOriginstringYesAllowed origin/domain where the game is launched.
buildIdnumberYesGame build identifier.
gameVersionIdnumberYesPublished game version identifier.
launchSourceenum(CATALOG_PLAY, CONSOLE_PREVIEW)NoLaunch source. Defaults to CATALOG_PLAY.
metadataobjectNoOptional launch metadata.

launchSource values

  • CATALOG_PLAY: Player launched the game from public catalog/store surfaces.
  • CONSOLE_PREVIEW: Developer/admin launched the game from console tools for internal preview/testing.
{
  "allowedOrigin": "https://chizverse.beespokedev.com/",
  "buildId": 120,
  "gameVersionId": 12,
  "launchSource": "CATALOG_PLAY",
  "metadata": {
    "region": "ph"
  }
}

Response Example

{
  "success": true,
  "response": {
    "launchToken": "launch_abc123",
    "apiBaseUrl": "https://api-chizverse.beespokedev.com",
    "expiresAt": "2026-05-06T11:00:00.000Z",
    "queryParams": {
      "chz_api_base_url": "https://api-chizverse.beespokedev.com",
      "chz_launch_token": "launch_abc123"
    }
  }
}

Getting launchToken

Use response.launchToken (or response.queryParams.chz_launch_token) from this endpoint as the launchToken value for Create Tracked Session.

Error Responses

StatusMeaningExample Message
400Invalid payloadbuildId is required
401Unauthorized clientUnauthorized
404Game/build/version not foundGame not found
500Internal server errorInternal server error

Create Tracked Session

Creates a new tracked session using a launch token.

Method & URL

POST /game-manager/v1.0/sdk/sessions

Headers

No custom headers required.

Request Body

NameTypeRequiredDescription
clientOriginstringYesOrigin identifier of the game client.
clientPlatformenum(web, desktop)YesPlatform where the game runs.
launchTokenstringYesLaunch token from Create Launch (response.launchToken or response.queryParams.chz_launch_token).
sdkVersionstringYesSDK version sending the request.
metadataobjectNoOptional extra context data.
{
  "clientOrigin": "chizverse-portal",
  "clientPlatform": "web",
  "launchToken": "launch_abc123",
  "sdkVersion": "1.2.0",
  "metadata": {
    "gameId": "space-racer",
    "region": "ph"
  }
}

Response Example

{
  "success": true,
  "response": {
    "acceptedEventTypes": [
      "game.session.started",
      "game.presence.changed",
      "game.score.updated",
      "game.metric.recorded",
      "game.progress.updated",
      "game.session.paused",
      "game.session.resumed",
      "game.session.ended",
      "game.session.heartbeat"
    ],
    "flushIntervalMs": 5000,
    "heartbeatIntervalSeconds": 30,
    "maxBatchSize": 20,
    "sessionId": "123",
    "sessionKey": "sesskey_abc123"
  }
}

Error Responses

StatusMeaningExample Message
400Invalid payloadlaunchToken is required
401Unauthorized clientUnauthorized
404Launch token not foundInvalid launch token
500Internal server errorInternal server error

Tracking Flow

  1. Call Create Launch to get a launchToken.
  2. Call Create Tracked Session with that launchToken.
  3. Use returned sessionId and sessionKey for Ingest Event Batch.

Get Session Checkpoint

Returns the latest active tracked-session state. Use this after session start to resume score, level, presence, and progress snapshot state.

Method & URL

GET /game-manager/v1.0/sdk/sessions/{sessionId}/checkpoint

Headers

NameTypeRequiredDescription
x-session-keystringYesSession key returned by Create Tracked Session.

Path Parameters

NameTypeRequiredDescription
sessionIdstringYesActive tracked session ID.

Response Example

{
  "success": true,
  "response": {
    "sessionId": "123",
    "gameId": 27,
    "gameVersionId": 12,
    "buildId": 120,
    "status": "active",
    "presenceState": "in_game",
    "levelId": "zone-3",
    "currentScore": 1250,
    "progressSnapshot": {
      "levelId": "zone-3",
      "completionPercent": 60,
      "checkpointId": "checkpoint-3",
      "metadata": {
        "coins": 240
      }
    },
    "lastSequence": 18,
    "lastEventAt": "2026-05-06T10:35:00.000Z"
  }
}

Error Responses

StatusMeaningExample Message
401Missing or invalid session keyUnauthorized
404Session not foundSession not found
409Session is not activeSession is not active.
500Internal server errorInternal server error

Get Saved Player Progress

Returns the latest durable progress for the player and game associated with the authenticated session. This is separate from the active-session checkpoint and can survive a new session key.

Method & URL

GET /game-manager/v1.0/sdk/sessions/{sessionId}/player-progress

Headers

NameTypeRequiredDescription
x-session-keystringYesSession key returned by Create Tracked Session.

Path Parameters

NameTypeRequiredDescription
sessionIdstringYesTracked session ID used to identify the player and game.

Response Example

{
  "success": true,
  "response": {
    "gameId": 27,
    "uid": 1024,
    "levelId": "campaign-1-level-3",
    "progressSnapshot": {
      "levelId": "campaign-1-level-3",
      "completionPercent": 100,
      "milestoneKey": "level_completed",
      "metadata": {
        "nextLevelId": "campaign-1-level-4",
        "saveState": {
          "health": 85,
          "coins": 240
        }
      }
    },
    "lastSessionId": "123",
    "lastEventAt": "2026-05-06T10:35:00.000Z"
  }
}

When no saved progress exists, the endpoint returns:

{
  "success": true,
  "response": null
}

Error Responses

StatusMeaningExample Message
401Missing or invalid session keyUnauthorized
404Session not foundSession not found
500Internal server errorInternal server error

Ingest Event Batch

Ingests an ordered batch of gameplay events for an active session.

Method & URL

POST /game-manager/v1.0/sdk/events/batch

Headers

NameTypeRequiredDescription
x-session-keystringYesSession key returned by session initialization.

Request Body

NameTypeRequiredDescription
sessionIdstringYesSession identifier for event ownership.
eventsarrayYesOrdered list of events to ingest.
events[].eventIdstringYesUnique event identifier.
events[].eventTypestringYesEvent name/category.
events[].eventVersionnumberYesEvent schema version.
events[].occurredAtstring(date-time)YesEvent timestamp (ISO-8601).
events[].sequencenumberYesIncremental order in the session.
events[].sessionIdstringYesSession identifier repeated per event.
events[].clientOriginstring | nullNoOptional origin marker.
events[].clientPlatformenum(web, desktop)YesOrigin platform of event.
events[].sdkVersionstringYesSDK version emitting event.
events[].payloadobjectYesEvent-specific payload.
{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_001",
      "eventType": "quest.completed",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:30:00.000Z",
      "sequence": 14,
      "sessionId": "sess_123",
      "clientOrigin": "chizverse-portal",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "questId": "daily-coin-run",
        "coinsEarned": 250
      }
    }
  ]
}

Response Example

{
  "success": true,
  "response": {
    "accepted": 1,
    "lastSequence": 14,
    "published": 1,
    "rejected": 0
  }
}

Error Responses

StatusMeaningExample Message
400Invalid payloadevents is required
401Invalid session keyUnauthorized
404Session not foundSession not found
500Internal server errorInternal server error

Event Mapping

  • setPresence -> game.presence.changed
  • trackScore -> game.score.updated
  • trackMetric -> game.metric.recorded
  • updateProgress -> game.progress.updated
  • saveProgress -> queues game.progress.updated, flushes the batch, then reads saved progress
  • pauseSession -> game.session.paused
  • resumeSession -> game.session.resumed
  • endSession -> game.session.ended
  • flush -> sends all queued event types in one batch

Usage Examples

setPresence -> game.presence.changed
Use this when player presence/state changes (for example menu, in-game, paused).

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_presence_001",
      "eventType": "game.presence.changed",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:30:00.000Z",
      "sequence": 10,
      "sessionId": "sess_123",
      "clientOrigin": "chizverse-portal",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "state": "menu",
        "reason": "opened_inventory"
      }
    }
  ]
}

trackScore -> game.score.updated
Use this to report score updates, including both total score and incremental delta.

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_score_001",
      "eventType": "game.score.updated",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:31:00.000Z",
      "sequence": 11,
      "sessionId": "sess_123",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "score": 1250,
        "delta": 50,
        "reason": "combo_x5"
      }
    }
  ]
}

trackMetric -> game.metric.recorded
Use this for custom gameplay metrics such as counters, gauges, or labeled telemetry values.

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_metric_001",
      "eventType": "game.metric.recorded",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:32:00.000Z",
      "sequence": 12,
      "sessionId": "sess_123",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "metricKey": "bullets_fired",
        "value": 3,
        "aggregation": "increment",
        "labels": {
          "weapon": "pistol"
        }
      }
    }
  ]
}

updateProgress -> game.progress.updated
Use this to report progression milestones like level advancement or completion percentage.

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_progress_001",
      "eventType": "game.progress.updated",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:33:00.000Z",
      "sequence": 13,
      "sessionId": "sess_123",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "levelId": "zone-3",
        "completionPercent": 60
      }
    }
  ]
}

pauseSession -> game.session.paused
Use this when gameplay is temporarily paused and the session should be marked inactive.

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_pause_001",
      "eventType": "game.session.paused",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:34:00.000Z",
      "sequence": 14,
      "sessionId": "sess_123",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "reason": "player_paused"
      }
    }
  ]
}

resumeSession -> game.session.resumed
Use this when gameplay resumes after a pause and active play continues.

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_resume_001",
      "eventType": "game.session.resumed",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:35:00.000Z",
      "sequence": 15,
      "sessionId": "sess_123",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "reason": "player_unpaused"
      }
    }
  ]
}

endSession -> game.session.ended
Use this when a run/match ends, including final outcome details (reason, score, duration).

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_end_001",
      "eventType": "game.session.ended",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:36:00.000Z",
      "sequence": 16,
      "sessionId": "sess_123",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "reason": "completed",
        "finalScore": 4200,
        "durationSeconds": 180
      }
    }
  ]
}

flush -> batch send of queued events
Use this to immediately send queued events instead of waiting for the next automatic batch cycle.

{
  "sessionId": "sess_123",
  "events": [
    {
      "eventId": "evt_any_001",
      "eventType": "game.metric.recorded",
      "eventVersion": 1,
      "occurredAt": "2026-05-06T10:40:00.000Z",
      "sequence": 20,
      "sessionId": "sess_123",
      "clientPlatform": "web",
      "sdkVersion": "1.2.0",
      "payload": {
        "metricKey": "deaths",
        "value": 1,
        "aggregation": "increment"
      }
    }
  ]
}

Get Game Leaderboard

Fetches leaderboard standings for a game. The SDK calls this directly and it does not require an active tracked session.

Method & URL

GET /leaderboard/v1.0/leaderboards/games/{gameId}

Path Parameters

NameTypeRequiredDescription
gameIdstring | numberYesGame identifier.

Query Parameters

NameTypeRequiredDefaultDescription
typeenum(ALL_TIME, DAILY, WEEKLY)NoALL_TIMELeaderboard period.
limitnumberNo5Number of entries to return. Capped at 20.

Response Example

{
  "success": true,
  "response": {
    "entries": [
      {
        "id": 501,
        "leaderboardId": 44,
        "uid": 1024,
        "rank": 1,
        "score": 4200,
        "playerSnapshot": {
          "displayName": "Juan",
          "avatar": "https://cdn.example.com/avatar.png"
        }
      }
    ],
    "leaderboardId": 44,
    "leaderboardType": "ALL_TIME",
    "resetAt": null,
    "totalPlayers": 12
  }
}

If no leaderboard has been created for the game yet, the API returns an empty response:

{
  "success": true,
  "response": {
    "entries": [],
    "leaderboardId": null,
    "leaderboardType": "ALL_TIME",
    "resetAt": null,
    "totalPlayers": 0
  }
}

Error Responses

StatusMeaningExample Message
422Invalid game idInvalid game id.
500Internal server errorInternal server error

New Session Flow

The SDK startNewSession() helper creates a fresh launch and then creates a fresh tracked session. Use the same API sequence when implementing this flow manually:

  1. End or flush the current session as appropriate.
  2. Call Create Launch again with the same gameId, buildId, and gameVersionId.
  3. Call Create Tracked Session with the new launchToken.
  4. Continue sending gameplay events with the new sessionId and sessionKey.

This is useful for a New Game button where each run should have a separate tracked session and leaderboard outcome.

Modified at 2026-07-30 06:57:16
Previous
Verify Session Key
Next
Create Launch
Built with