Skip to main content
The event ingestion endpoint lets you send multiple gameplay events in a single HTTP call. Batching reduces network overhead and powers automated features like coin rewards — the server processes LevelCompleted events to award coins as soon as they are flushed from the queue. You can include up to 200 events per request.
1

Authenticate your request

POST /ingest/events requires a valid Bearer token. Use the access_token obtained from registration or login.
If the token is missing or expired, the server returns 401 UNAUTHORIZED. If the token is valid but the user_id in the payload does not match the token’s sub claim, the server returns 403 FORBIDDEN.
2

Build your event batch

Every request body has three top-level fields:Each event object in the events array has:
3

Choose your event types

PlaySmart supports six event types:When sending a Custom event, include customEventName in the event object alongside type. For example:
4

Send the batch

Post your assembled batch to POST /ingest/events:
The server responds with 202 Accepted:

Timestamp format

All timestamp values must be ISO 8601 strings with an explicit timezone offset. UTC is recommended:
Timestamps without a timezone offset are rejected with a 400 BAD_REQUEST.

customdata

The customdata field accepts any flat or nested JSON object. Use it to attach context that is useful for analytics or debugging — for example, the level number, score, ad unit ID, or purchase SKU. There is no enforced schema, but keep payloads small to avoid unnecessary overhead.
A 202 Accepted response means the events were received and queued in memory. They are flushed to the database within a few seconds. There is no need to retry a 202 response.
The user_id in the request body must exactly match the sub claim in the Bearer token. Sending events on behalf of another user returns 403 FORBIDDEN with error code user_id_mismatch.