API mocks

On this page

Mixpanel

A test-only ingestion subset for events and user profiles. Create Mixpanel under Systems → Analytics, alongside Segment. Nothing is sent to a Mixpanel project.

Testlie is independent of Mixpanel. The name identifies compatibility, not affiliation or certification.

Events

Replace the Mixpanel ingestion host with your system's base URL. POST /track with JSON:

json
[{ "event": "Test signup", "properties": { "token": "<projectToken>", "distinct_id": "test-user-1", "plan": "team" } }]

Use the generated test projectToken. event and string distinct_id are required (255 characters maximum). Optional time is a nonnegative Unix timestamp. $insert_id is retained, without simulating real Mixpanel's asynchronous deduplication or identity merging. IP geolocation, five-day event age rules, automatic timestamps/enrichment and report aggregation are not simulated.

User profiles

POST /engage with one operation per profile object:

json
[{ "$token": "<projectToken>", "$distinct_id": "test-user-1", "$set": { "plan": "team", "logins": 1 } }]

Supported operations: $set, $set_once, numeric $add, $unset (string array), $delete (empty string or null). Profile deletion tombstones the stored test object; a later set starts from empty values. This is retained test data governed by Testlie's retention, not a privacy deletion endpoint. $ip/$ignore_time are accepted without enrichment or activity-time behavior. Group profiles, list union/append/remove, identity aliases and data exports are unsupported.

Formats and acknowledgements

Accepts one JSON object or an array. Form encoding uses a data field containing JSON or base64 JSON (Content-Type: application/x-www-form-urlencoded). Compressed bodies, GET/pixel ingestion, callbacks/JSONP, /import, query/report APIs and service-account authentication are unsupported.

Success is text 1; ?verbose=1 returns { "status": 1 }. Invalid data returns a failing status with text 0 or a verbose error. Testlie enforces its generated project token: missing/wrong tokens return HTTP 200 with 0 (or { "status": 0, "error": "..." }), consume no monthly quota and have throttled diagnostic captures. Real Mixpanel's ingestion acknowledgement does not guarantee token validity. Credential rotation invalidates the old token.

ip=0/1 is accepted without geolocation. Supported query flags accept only 0/1. Tokens are removed from stored events/profiles and masked from JSON/form/base64 capture bodies. Malformed/unsupported request bodies are omitted from captures.

Inspection, scenarios and limits

Captured calls and stored event/profile objects are available in Testlie's existing UI/API. Native Mixpanel reporting APIs and webhooks are not implemented.

At most 50 operations per call, 128 KB per request, 100 keys per property object/profile, 100 elements per array and object depth three. Strings are limited to 4,000 characters; numbers must be finite and within ±1 trillion. Nested arrays are unsupported. At most 500 active events and 500 active profiles; shared listing scans the newest 1,000 record objects across types, and plan retention/object limits apply.

All tokens and request shapes are validated before writes. A batch is not transactional: state-dependent profile errors, concurrent conflicts or capacity limits may occur after earlier writes. Profile updates use compare-and-swap; retry conflicts after reading the captured result. Event ingestion can be repeated, so keep test assertions scoped to your fixture.

Rate-limit, server-error and delay scenarios apply. Decline rejects ingestion. No interactive Require action flow exists. Use test data only.

Contracts: track events and user profiles.