Events
SDKs post what they observed in batches: evaluation summaries (how often each flag served each variation, and why), aliases (the unit ID in use before sign-up linked to the one after) and exposures.
POST /sdk/v1/eventsAuthorization: Bearer fn_cli_…Content-Type: application/json
{"schema_version": 1, "sdk": {"name": "flagnetic-go", "version": "1.4.0", "platform": "linux"}, "sent_at": "2026-09-19T10:00:00Z", "events": [ {"type": "evaluation_summary", "event_id": "01a0b91b-c500-7000-8000-000000000003", "interval_start": "2026-09-19T09:59:00Z", "interval_end": "2026-09-19T10:00:00Z", "ruleset_version": 1745040000000, "app_version": "1.18.0", "counts": [{"flag": "checkout", "variation": "true", "reason": "targeting_match", "count": 3}]}, {"type": "alias", "event_id": "01a0b91b-c500-7000-8000-000000000001", "occurred_at": "2026-09-19T10:00:00Z", "from_unit_type": "anonymous", "from_unit_id": "d-8f1c", "to_unit_type": "user", "to_unit_id": "u-1001"} ]}Either kind of key may post. The answer is 202 once every accepted event is durable, so the SDK can drop what it sent:
{"accepted": 2, "duplicates": 0, "dropped_rows": 0, "rejected": []}The batch and each event
The batch is refused as a whole only for its envelope, its key, its size, a rate limit or a server error; the SDK retries those with the same event IDs, except a 4xx other than 401, 403 and 429, which it drops.
| Limit | Refusal |
|---|---|
At most 500 events and 1 MiB after decompression; it may be sent gzip with Content-Encoding: gzip |
413 request_too_large |
schema_version 1, sdk.name and sdk.version non-empty strings, sdk.platform a string or absent, each at most 256 bytes without U+0000, sent_at an RFC 3339 time, events a list |
400 invalid_request, with every member at fault in errors |
Otherwise each event is judged on its own and a refused one is listed in rejected with its index, its event_id when it sent one as a string, a code and a detail. The SDK never sends a rejected event again. The codes are an open set a later server may add to:
| Code | When |
|---|---|
event_invalid |
A member is missing, of the wrong type, a string over 256 bytes or holding U+0000; a summary holds no row or over 1,000 rows, a row counts less than 1 or names a reason that is none, or its interval starts after it ends; an alias names the same unit type on both sides. |
event_type_unknown |
The server does not know events of this type. |
event_id_invalid |
event_id is not a lowercase UUIDv7. |
out_of_window |
The time in event_id, or occurred_at (interval_end for a summary), is older than the retention window once a wrong device clock’s shift (below) is applied. |
undeclared_unit_type |
An alias names a unit type the project does not declare. A client key is answered event_invalid instead, which names nothing of the project. |
unknown_experiment |
An exposure names no experiment of the project, or a draft, which is served to no unit so no SDK holds an exposure of one. A started experiment of any status exists, a stopped one too, since a mobile app may flush its queue days after the exposure. |
unit_type_mismatch |
An exposure’s unit_type is not the unit type its experiment assigns. |
quota_exceeded |
An alias would link a new pair in an environment that holds as many links as the operator allows (FLAGNETIC_ALIAS_LINKS_LIMIT), or an exposure would be the first of a new unit of an experiment that holds as many as the operator allows (FLAGNETIC_FIRST_EXPOSURES_LIMIT). An alias of a pair already linked and an exposure of a unit already counted are still accepted. Sending the event again does not help until the operator raises the limit. |
unknown_variation |
An exposure names a variation its experiment does not weigh. An exposure with override true may name any variation of the experiment’s flag instead, since an override decides the variation whatever the weights are. |
An exposure carries what the evaluation that assigned the unit answered, so the server can check it against the experiment:
{"type": "exposure", "event_id": "01a0b91b-c500-7000-8000-000000000011", "occurred_at": "2026-09-19T10:00:00Z", "experiment_key": "banner_test", "flag_key": "banner_text", "variation_key": "long", "unit_type": "user", "unit_id": "u-1001", "evaluation_reason": "experiment", "override": false, "ruleset_version": 1, "platform": "linux", "app_version": "1.18.0"}An exposure of an experiment the project has is accepted whatever the experiment’s status once it has started, a stopped one too, and refused while it is a draft. An exposure is accepted for what it says: the server does not recompute the unit’s assignment, so an exposure posted with a client key is untrusted (see What a client key still learns). It is counted toward its exposures.
An exposure is judged against its experiment in this order, and refused with the first check it fails: the experiment exists, the unit type is its own, the variation is one it weighs, then flag_key must be the experiment’s flag and evaluation_reason experiment or override (both event_invalid). A server key is told the code of the check it failed, with a detail naming what was wrong. A client key is told unknown_experiment for every refusal, whatever the exposure got wrong and whether the experiment exists, is a draft or is none: a key that ships inside an app learns nothing of an experiment from it. Exposures refused for an experiment that exists are counted per experiment, environment and reason, and a refused exposure is counted once, by its event_id, however often it is sent; the counts go with the experiment; an exposure naming an experiment that does not exist is counted nowhere.
An accepted alias links its pair of unit IDs in the environment of the key, once: the pair sent again under another event_id, as an app signing the same user in again does, is stored as an event but adds no link, and the link keeps the alias that occurred earliest. Links are kept for as long as the environment exists, after retention drops the raw aliases, but they only keep a pair linked once and count against the limit on links; nothing reads them out. To join an anonymous ID to the ID known after sign-up, use the aliases a sink received: a sink enabled after retention dropped an alias does not get it.
A summary row’s reason is a true reason (rule, rollout, fallthrough, prerequisite_failed, off, override, experiment, error), the SDK’s own fallback or local_override, or targeting_match, which a client SDK counts from the answers it receives. A row naming a flag the project does not have (an archived flag is still one), or a variation its flag does not have, is dropped and counted in dropped_rows; the rest of its summary is stored. A summary all of whose rows are dropped is accepted and stores nothing, so the evaluation volume and the check that a flag was evaluated do not count it. A client key is always told 0, since a count would tell whether a flag key it guessed is a flag of the project. A row’s variation may be null, when no variation was served.
An event’s time more than 24 hours ahead of the server clock is taken as the time the event was received. A summary’s interval_start before the oldest instant of the retention window is stored as that instant.
When sent_at differs from the time the server received the batch by more than one minute, the SDK’s clock is taken to be wrong, and every time in the batch (occurred_at of an alias or an exposure, interval_start and interval_end of a summary) is shifted by the server’s time minus sent_at before it is checked against the retention window and stored. The window check reads the time in event_id plus the same shift, so a phone whose clock is behind by more than the retention window keeps its fresh events; the stored event_id and its time are never shifted. A phone whose clock is wrong thereby neither loses its events as out_of_window nor moves an exposure in time.
An event that really is older than the window is still refused: a retry stamps a fresh sent_at, so nothing shifts its event_id back into the window. A verbatim replay of an old envelope is the exception, since its sent_at is as old as its IDs and the shift lands it inside the window. Only its recorded event_id refuses it, so the server keeps event IDs for a year (or the retention window plus a day, if that is longer) and answers such a replay as a duplicate. A replay of an envelope older than that is accepted again, since nothing remembers its IDs.
From a closing page
A browser page that is closing hands its last batch, exposures included, to navigator.sendBeacon. A beacon cannot set headers and is sent without a CORS preflight, while a keepalive fetch carrying Authorization and JSON would need one, which browsers do not send for such a request: the last exposures of a visit would be lost and bias an experiment. So a batch is also accepted with a client key as the query parameter sdk_key and the envelope sent as text/plain, which is what a beacon sends a string as:
POST /sdk/v1/events?sdk_key=fn_cli_…Content-Type: text/plain;charset=UTF-8
{"schema_version": 1, "sdk": {"name": "flagnetic-js", "version": "1.0.0", "platform": "web"}, …}The body is read as JSON, with the same limits and answers as above, and the request is judged like any other from a browser: the key’s allowed origins apply and the client events rate limit counts it (see Browsers). A server key in the query is refused 403 server_key_in_query, since it would end up in logs; a key both in Authorization and in the query is refused 400 invalid_request. Any other media type than application/json and text/plain is 415 unsupported_media_type.
Retries
Each event is stored once by its event_id, per project, for a year (or the retention window, FLAGNETIC_EVENTS_RETENTION_DAYS, 30 days by default, plus a day if that is longer): an event received before, in an earlier batch, on any replica and on any day, or earlier in the same batch, is counted in duplicates. An SDK retrying a batch therefore resends it with the same IDs.
Evaluations answered remotely
The server counts the remote evaluations it answers, per key, SDK, platform, app version, flag, variation and true reason (the reason before a client key’s answer is masked), and writes the counts every minute, and once more when a replica stops, as evaluation summaries of its own. They are kept apart from the summaries SDKs post, so the evaluations a client SDK also counts from the answers it received are never added twice. The SDK is the one the request names (see How an SDK names itself), or unknown; the app version is the context’s app_version attribute when it is a string.