Event Tracking API
POST /v1/track
Section titled “POST /v1/track”Send analytics events from your game. Accepts a single event or an array of up to 100 events.
Auth: x-game-api-key header
Single Event
Section titled “Single Event”curl -X POST https://api.questdata.io/v1/track \ -H "Content-Type: application/json" \ -H "x-game-api-key: YOUR_API_KEY" \ -d '{ "event_name": "level_complete", "session_id": "sess-abc123", "player_id": "player-456", "properties": { "level": 5, "score": 1200, "duration_seconds": 120 } }'Batch (up to 100 events)
Section titled “Batch (up to 100 events)”curl -X POST https://api.questdata.io/v1/track \ -H "Content-Type: application/json" \ -H "x-game-api-key: YOUR_API_KEY" \ -d '[ {"event_name": "game_start", "session_id": "sess-abc"}, {"event_name": "level_start", "session_id": "sess-abc", "properties": {"level": 1}} ]'Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
event_name | string | Yes | Event identifier (e.g. "level_complete") |
session_id | string | Yes | Current game session ID |
player_id | string | No | Persistent player identifier |
properties | object | No | Arbitrary event data |
client_timestamp | string | No | ISO 8601 timestamp from client |
Response (202 Accepted)
Section titled “Response (202 Accepted)”{ "received": 2, "quota": { "remaining": 99998, "limit": 100000 }}If event schema validation is enabled and some events have violations, a warnings array is included.
Error Responses
Section titled “Error Responses”| Status | Body | Cause |
|---|---|---|
| 400 | { "error": "...", "violations": [...] } | Invalid event schema |
| 413 | { "error": "...", "limit": 100, "received": 150 } | Batch too large |
| 429 | { "error": "...", "quota": { "current": ..., "limit": ..., "remaining": 0 } } | Quota exceeded |