Skip to main content
The REST API is currently in alpha. APIs and behavior may change between releases.
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.
The Immutable REST API sends events to the Audience analytics pipeline over HTTP. It uses the same event schemas as the Web SDK and powers Attribution measurement. Because events originate from your server, they are authoritative and cannot be dropped by ad blockers or manipulated client-side, making the REST API the recommended source for purchase confirmations and other high-value events. Send a JSON payload with the event type, name, and properties, and it flows into the same pipeline as all other surfaces.

When to Use the REST API

What You Need

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)
Response:

Authentication

Sending events, recording consent, and reading consent all require a publishable key in the x-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. 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. Call this when a user accepts or declines tracking:
Response: 204 No Content Retrieve a stored consent preference at session start:
If no consent has been recorded, the response is { "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’s anonymousId 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.
Never expose your secret API key client-side. Keep it in a server environment variable and make this call from your backend only.
A concrete server-side example (Node.js):
Response: 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:
The endpoint returns 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.
Use these to pass environment metadata alongside the required library and libraryVersion. Include whichever are relevant. All are optional.

Event Types

Record a named event. The most common message type.Also required: eventName, plus userId or anonymousId
Use any eventName. Predefined events have defined property schemas. See the Data Dictionary for the full list. Custom event names are also supported.
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 anonymousId
identityType values: passport, steam, epic, google, apple, discord, email, custom
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.
Record a page view. Useful for server-side rendering where you capture page loads on the server.Also required: userId or anonymousId
Record a screen view in a game client or app. Same schema as page.
For predefined event names and their property schemas (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