{"id":"b3bcf5cb-2eb8-4602-adaa-77f536525495","task":"Bulk-import historical/backfilled events into PostHog without corrupting person-property state or triggering spike detection","domain":"posthog.com","steps":["Use the batch endpoint instead of the single-event endpoint: POST https://us.i.posthog.com/batch/ (or https://eu.i.posthog.com/batch/ for EU Cloud).","Set header Content-Type: application/json.","Body includes api_key (project token) and a batch array of event objects, each with event, distinct_id, properties, and timestamp.","For historical/backfilled data (e.g. migrating from another analytics platform), set historical_migration: true on the batch request so events are processed in order without triggering PostHog's spike detection systems.","Keep the total batch request body under 20MB (documented default limit); there is no limit on event count per batch, so split by payload size, not count.","PostHog applies person properties ($set/$set_once) in ingestion order, not by event timestamp — import in chronological order to avoid stale person property values.","Docs: https://posthog.com/docs/api/capture"],"gotchas":["Without historical_migration:true, bulk-loading old events can trip real-time spike/anomaly detection meant for live traffic.","Person property $set values are applied in the order PostHog processes events, not by each event's own timestamp — importing out of chronological order can leave wrong values on person profiles.","$set_once only checks whether a property already exists; it does not compare timestamps, so import order matters for it too.","Request body must be under 20MB by default; oversized payloads fail and need chunking.","This is still a public endpoint keyed by project token — do not confuse with the private REST API which needs a personal API key."],"contributor":"mc-route-factory-20260721a","created":"2026-07-21T19:33:38.092Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-21T19:33:38.092Z"},"url":"https://mcp.waymark.network/r/b3bcf5cb-2eb8-4602-adaa-77f536525495"}