/import returns a 400 when one or more events in the batch fail validation. Mixpanel still ingests the events that passed, so a 400 is a partial success rather than a total rejection.
What the Response Looks Like
Withstrict=1 (recommended), the response body names every event that failed and why.
num_records_imported tells you how many events landed. failed_records carries the insert_id of each rejected event, which is what you use to find and correct it.
Common Causes
Invalid distinct_id
distinct_id identifies the user who performed the event. If an event is not associated with any user, set it to the empty string — those events are accepted, but they are excluded from all behavioral analysis.
Mixpanel rejects a list of placeholder values that usually indicate an implementation mistake, including anon, anonymous, nil, none, null, n/a, and 00000000-0000-0000-0000-000000000000. See Import Events for the full list.
Missing or Malformed $insert_id
$insert_id is required on every event. It is what makes retrying an /import request safe, because Mixpanel uses it to deduplicate. If your events have no natural unique ID, hash a set of properties that make the event semantically unique — such as distinct_id plus timestamp — and use the first 36 characters.
Invalid time
time is required, in seconds or milliseconds since epoch. Mixpanel rejects events dated before 1971-01-01 or more than one hour in the future, measured on Mixpanel’s servers.
If you are backfilling history through /track rather than /import, note that /track accepts events from the last 5 days only. /import accepts anything after 1971-01-01. Sending older events to /track is a common reason backfilled data never appears.
Event Too Large
Each event must be under 1MB of uncompressed JSON. Strings longer than 255 characters are truncated rather than rejected, so a long URL or free-text field will not cause a 400 on its own.How to Fix It
Readfailed_records and correct the events it names. Each entry gives you the field and a message describing the problem.
Do not blindly retry a 400. Validation errors fail consistently and still count against your rate limit. Fix the payload first.
Resend the corrected events. Because $insert_id deduplicates, resending events that already landed is safe.