Ingest
Send events
Send a batch of up to 500 analytics events from a game server, with the envelope, every field, deduplication and partial rejection explained.
https://api.bloxlytics.app/v1/ingestcurl -X POST https://api.bloxlytics.app/v1/ingest \
-H "Content-Type: application/json" \
-H "Authorization: Bearer bxw_…" \
-H "X-Bloxlytics-Project: <universe id>" \
-d '{
"protocol": 1,
"sdk": { "name": "my-client", "version": "1.0.0" },
"server": { "jobId": "<job id>", "placeId": 1234567890, "placeVersion": 42, "isStudio": false },
"events": [
{
"id": "6F1C2E8C-7B6B-4E0A-9D3F-2A1B5C4D7E9F",
"name": "$session_start",
"ts": 1767225600.125,
"userId": 1,
"sessionId": "0B7E4D2A-1C3F-4A5B-8D9E-6F7A8B9C0D1E",
"props": { "username": "<username>", "premium": false, "locale": "en-gb", "country": "GB" }
},
{
"id": "A2B3C4D5-E6F7-4890-A1B2-C3D4E5F60718",
"name": "PetHatched",
"ts": 1767225612.5,
"userId": 1,
"sessionId": "0B7E4D2A-1C3F-4A5B-8D9E-6F7A8B9C0D1E",
"props": { "PetName": "Dragon", "Rarity": "Legendary", "EggCost": 500 }
}
]
}'{ "accepted": 2, "rejected": 0 }Sends a batch of events from one game server. This is the endpoint the Luau SDK flushes its queue to, every 10 seconds by default or sooner when the queue reaches the batch size.
The API checks the batch, answers 202 Accepted straight away and processes the events afterwards. Accepted events usually appear on the Realtime page within a few seconds. Authenticate with the project's write key; see Authentication.
#Headers
Content-Typestringheaderrequiredapplication/json.
AuthorizationstringheaderrequiredBearer followed by the project's write key, bxw_…. A bridge key is refused.
X-Bloxlytics-ProjectstringheaderrequiredThe experience's Universe ID, as a decimal string (game.GameId in a running server). Legacy UUID project IDs are also accepted.
#Body
The body is one JSON object, at most 1 MB (1,048,576 bytes). Fields not listed here are ignored.
protocolnumberbodyrequiredThe wire protocol version. Must be 1.
sdkobjectbodyrequiredWhich client sent the batch. The version is shown as SDK version in the project's SDK debugger.
serverobjectbodyrequiredThe game server the events come from. Every event in the batch is attributed to this server and place.
eventsEvent[]bodyrequiredBetween 1 and 500 events. Each is checked on its own; see Partial rejection. The full rules, including every reserved event, are on Event format.
#Response
202 Accepted when at least one event passed validation.
acceptedintegerrequiredHow many events passed validation and will be processed.
rejectedintegerrequiredHow many events in the batch failed validation and were discarded. 0 when every event was valid.
accepted counts events before the checks that run during processing (below), so a few of them may still be discarded. Duplicates are also counted here and dropped later.
#Validation
The request is checked in this order. The first failure ends it.
- Size and JSON. Over 1 MB:
413. Not valid JSON:400. See Errors. - Credentials. Project header and write key:
401 unauthorized. - Rate limit. Over 3,000 batches a minute for the project:
429 rate_limited. - Envelope.
protocol,sdk,server, andeventsbeing an array of 1 to 500 items. Any problem:400 invalid_batch. - Each event. Checked against the event format:
id,name,ts,userId,sessionIdandprops.
#Partial rejection
A bad event doesn't cost you the rest of the batch:
- If some events are invalid, the valid ones are accepted and the response is
202withrejectedgreater than0. - If every event is invalid, the response is
400 invalid_batch, and the message names the first bad event, for exampleRejected batch: events.0.ts (PetHatched) Too small: expected number to be >0.
Either way, the first problem is recorded under Recent problems in the project's SDK debugger, for example Rejected 2 of 40 events: events.7.ts (Upgrade) Too small: expected number to be >0.
#Checks during processing
After the batch is accepted, each event goes through checks that depend on your project's settings. Events that fail are discarded and the reason is added to Recent problems (up to five distinct reasons per batch), without changing the response you already got.
| Check | Result |
|---|---|
ts more than 5 minutes in the future |
The event is kept, with its time set to when the batch arrived. |
ts more than 30 days in the past |
Discarded: timestamp older than 30 days. |
| Reserved event with properties that don't match its definition | Discarded, with the property and problem. |
Reserved player event without userId |
Discarded: <name> requires userId. |
Name starting with $ that isn't a reserved event |
Discarded: Unknown reserved event <name>. |
| Custom name that doesn't match the naming rule | Discarded: Invalid event name "<name>". |
| Session, economy or purchase tracking turned off | Those events are discarded. |
| Custom events turned off, or the name is in Blocked events | Discarded. |
| Economy event in a currency that isn't configured, when currencies are configured | Discarded: Unknown currency "<currency>" — add it in SDK settings. |
| Custom-event string value over 256 characters | Kept, with the string cut to 256 characters. |
The settings are on the project's SDK page under Configuration; see Project settings and Remote configuration.
#Deduplication
Bloxlytics keeps every event id it processes, per project, for 48 hours. An event that arrives again with the same id in that time is dropped silently. This makes retries safe: if a request times out and you can't tell whether it arrived, send the same batch again with the same ids.
Give every new event a new id. Reusing an id for a different event within 48 hours loses the second one.
#Batching guidance
- Send events from one server per request: the
serverobject applies to every event in the batch. - The SDK sends at most
maxBatchSizeevents per request (200 by default, from 10 to 500 in project settings). Batches with many long string properties can pass 1 MB before they reach the count limit, and a413loses the whole batch, so if you write your own client, split batches by encoded size as well as by count. - Retry
429,5xxand network failures with backoff. Don't retry other4xxresponses. See Errors.