GameAnalytics Collection API

HMAC-signed event ingestion (Collector API).

OpenAPI Specification

gameanalytics-collection-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: GameAnalytics REST APIs Collection API
  description: 'Representative OpenAPI description of the public GameAnalytics REST surfaces: the Collection (Collector) API for HMAC-signed event ingestion, the Metrics API for aggregated reporting, and the Organization API for programmatic administration of games, studios, users, and permissions. Endpoints and authentication reflect the public GameAnalytics documentation; consult the docs for the full request/response payloads, which are large and evolving.'
  termsOfService: https://gameanalytics.com/terms/
  contact:
    name: GameAnalytics Support
    url: https://gameanalytics.com/contact/
  version: '1.0'
servers:
- url: https://api.gameanalytics.com
  description: Collection API - production
- url: https://sandbox-api.gameanalytics.com
  description: Collection API - sandbox
- url: https://metrics.gameanalytics.com
  description: Metrics API
- url: https://organization.gameanalytics.com
  description: Organization API
tags:
- name: Collection
  description: HMAC-signed event ingestion (Collector API).
paths:
  /v2/{game_key}/init:
    post:
      operationId: collectionInit
      tags:
      - Collection
      summary: Initialize an SDK/collection session.
      description: Returns a server timestamp and an `enabled` flag before events are sent. The request body must be signed with an HMAC-SHA256 digest of the raw (optionally gzipped) body using the game secret key, base64-encoded, and supplied in the `Authorization` header. HTTPS is required.
      security:
      - hmacAuth: []
      parameters:
      - $ref: '#/components/parameters/GameKey'
      - $ref: '#/components/parameters/ContentEncoding'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitRequest'
      responses:
        '200':
          description: Initialization succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v2/{game_key}/events:
    post:
      operationId: collectionEvents
      tags:
      - Collection
      summary: Submit a batch of game events.
      description: Accepts a JSON array of event objects (categories include `user`, `session_end`, `business`, `resource`, `progression`, `design`, `error`, and `ads`). The gzipped body must be signed with an HMAC-SHA256 digest using the game secret key (base64) in the `Authorization` header. POST size limit is 1 MB; gzip is strongly recommended.
      security:
      - hmacAuth: []
      parameters:
      - $ref: '#/components/parameters/GameKey'
      - $ref: '#/components/parameters/ContentEncoding'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Event'
      responses:
        '200':
          description: Events accepted.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          description: Payload exceeds the 1 MB POST size limit.
components:
  parameters:
    ContentEncoding:
      name: Content-Encoding
      in: header
      required: false
      description: Set to `gzip` when the body is gzip-compressed (strongly recommended).
      schema:
        type: string
        enum:
        - gzip
    GameKey:
      name: game_key
      in: path
      required: true
      description: The public game key identifying the game in GameAnalytics.
      schema:
        type: string
  schemas:
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    InitResponse:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether event collection is enabled for this game.
        server_ts:
          type: integer
          format: int64
          description: Server-side Unix timestamp used to correct client clocks.
    InitRequest:
      type: object
      properties:
        platform:
          type: string
          example: ios
        os_version:
          type: string
          example: ios 17.0
        sdk_version:
          type: string
          example: rest api v2
    Event:
      type: object
      description: A single GameAnalytics event. The `category` field determines which additional fields are required. See the Collection API docs for the full set of fields per category.
      required:
      - category
      properties:
        category:
          type: string
          enum:
          - user
          - session_end
          - business
          - resource
          - progression
          - design
          - error
          - ads
          description: The event category.
        v:
          type: integer
          example: 2
        user_id:
          type: string
        session_id:
          type: string
        session_num:
          type: integer
        client_ts:
          type: integer
          format: int64
        sdk_version:
          type: string
        os_version:
          type: string
        manufacturer:
          type: string
        device:
          type: string
        platform:
          type: string
        build:
          type: string
        event_id:
          type: string
          description: For design/progression/resource events, the hierarchical event identifier.
        amount:
          type: number
          description: For business/resource events, the transaction or resource amount.
        currency:
          type: string
          description: For business events, the ISO 4217 currency code.
        value:
          type: number
          description: For design events, an optional numeric value.
  responses:
    Unauthorized:
      description: Missing or invalid authentication (bad HMAC signature or API key).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    hmacAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Base64-encoded HMAC-SHA256 digest of the raw (optionally gzipped) request body, keyed with the game's secret key. Used by the Collection API.
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key generated in the GameAnalytics dashboard. The Metrics API uses the `X-API-Key` header; the Organization API uses an equivalent API-key header.
Where this information came from

This is an independent, third-party profile of GameAnalytics Collection API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.