202 Accepted immediately, before the events have been written to persistent storage.
Available event types
PlaySmart recognises the following named event types:Event object structure
Each event in a batch must conform to the following shape:Custom event, include customEventName:
Batch structure
You send events toPOST /ingest/events as a single batch object. Every batch must include:
A single batch accepts a maximum of 200 events. If you have more than 200 events to send, split them into multiple requests.
Buffering and persistence
The ingest endpoint does not write directly to the database. Instead, events are pushed into an in-memory buffer. The buffer is flushed to the database in two situations:- Timed flush — the buffer flushes on a regular interval (typically every few seconds).
- Size flush — if the buffer accumulates a large number of events, it flushes immediately regardless of the timer.
202 Accepted response means the batch was accepted into the buffer — not that it has been persisted to the database yet.
message field tells you how many events from your batch were accepted and how many events are currently waiting in the buffer across all recent requests.
How events drive coin rewards
LevelCompleted events are the primary driver of coin awards in PlaySmart. When the event processor picks up a LevelCompleted event, it checks:
- Is
coins_enabledset totrueon the game? - Is
level_completion_enabledset totruein the game’s config?
trigger: "level_complete" and the player’s coins_balance increases.
Custom events can also drive coin awards when event_trigger_enabled is true in the game’s config. The processor counts custom events and fires a coin award once the count reaches event_trigger_threshold. Each award uses trigger: "event_trigger".
See the coin economy page for details on how coin amounts are calculated and how coins eventually convert to USD.
Stored event fields
Once flushed, each event is stored in theraw_events collection with additional server-set fields alongside the client-provided data:
Raw events are retained for 180 days before automatic expiry.
