Who is this for? Backend engineers and game server developers who need to send events from server-side code, such as purchase confirmations, server-authoritative game events, or login handlers.
When to Use the REST API
What You Need
- An Immutable Hub account with a project
- A publishable key from your project settings (API keys guide)
Quick Start
Replace
YOUR_SYSTEM_NAME with your own backend or system name (e.g. "my-game-server", "studio-backend").Avoid these names, which belong to Immutable products and will mix your events with theirs in analytics:"@imtbl/pixel"(Tracking Pixel)"@imtbl/audience"(Web SDK)"com.immutable.audience"(Unity SDK)
Authentication
Sending events, recording consent, and reading consent all require a publishable key in thex-immutable-publishable-key header. Deleting user data is the exception: since it’s a destructive, per-user operation, it requires your secret API key in the x-immutable-api-key header instead (a publishable key is public and can’t prove ownership of the data being erased).
The base URL is https://api.immutable.com. Manage your keys in Immutable Hub. See the API Keys guide for how to create one.
Consent
You are responsible for obtaining and recording user consent before sending tracking events. The REST API does not enforce consent on your behalf. Only send what the user has consented to. The same three-tier model (none / anonymous / full) applies as with the Web SDK. See the Data Dictionary → Consent Model for what each level allows. In brief: at none send nothing, at anonymous omit userId and PII, at full send everything.
Recording Consent
Call this when a user accepts or declines tracking:204 No Content
Reading Consent
Retrieve a stored consent preference at session start:{ "status": "not_set" }. Treat not_set the same as none.
Deleting User Data
To handle a GDPR Right to Erasure request, call this endpoint from your own backend with the user’sanonymousId or userId, not both. Unlike every other endpoint on this page, this call requires your secret API key, not your publishable key: the publishable key identifies a project, not a user, so it can’t prove the caller is authorized to erase a specific player’s data. This also means the call must originate from server-side code, never a browser or game client.
202 Accepted
Deletion is processed asynchronously. All tracking data and consent records associated with the identity, including any linked identities, are removed or anonymised across all storage layers.
API Reference
Endpoints
Sending Events
Headers:
Response:
200 OK even if some messages fail validation. Invalid messages are silently skipped. Check the rejected count to detect failures. A 400 means the entire request failed (invalid key or malformed body).
Message Schema
Most string fields accept up to 256 characters.
pageUrl, pagePath, and pageReferrer accept up to 2048.
Optional fields inside the context object
Optional fields inside the context object
Use these to pass environment metadata alongside the required
library and libraryVersion. Include whichever are relevant. All are optional.Event Types
track
track
Record a named event. The most common message type.Also required: Use any
eventName, plus userId or anonymousIdeventName. Predefined events have defined property schemas. See the Data Dictionary for the full list. Custom event names are also supported.identify
identify
Associates a user ID with their activity and traits. Send when a user logs in, creates an account, or updates their profile.Also required:
userId or anonymousIdidentityType values: passport, steam, epic, google, apple, discord, email, customalias
alias
Link two account IDs that belong to the same player. Use when a player connects a second account with a different provider, for example a Steam ID linked to an email account.Also required:
fromId, toId (must be different). from is the account being linked. to is the player’s canonical account.page
page
Record a page view. Useful for server-side rendering where you capture page loads on the server.Also required:
userId or anonymousIdscreen
screen
Record a screen view in a game client or app. Same schema as
page.purchase, progression, resource, sign_up, and more), see the Data Dictionary.
Error Responses
Next Steps
Attribution
How tracking data powers player attribution and Hub reports
Data Dictionary
Full reference of event schemas and consent levels
Web SDK
Typed SDK for web games, marketing sites, and SPAs
Unity SDK
In-game tracking for Unity desktop builds
Conversion Postbacks
Send attributed conversions back to ad networks to improve campaign optimisation
API Keys
Manage your publishable and secret keys