What the Response Looks Like
From/import:
Which Credentials Each Endpoint Accepts
Don’t rely on a 401 to catch a bad project token on
/track. The endpoint can return 200 with a body of 1, which confirms at least one object was well-formed but does not signify a valid project token or secret. Add ?verbose=1 to get a JSON response instead, and check your project’s live view to confirm events are arriving.Common Causes
Service Account Lacks the Required Role
/import requires an Owner or Admin Service Account. A Service Account with a lower role on the project can’t import, even if its username and secret are correct.
Missing project_id
When authenticating with a Service Account, project_id is required. Without it, Mixpanel cannot tell which project the credentials apply to.
Wrong Regional Endpoint
Projects with EU or India data residency use different hosts. Send requests to the host that matches your project’s residency.
See EU Residency and India Residency.
Malformed Basic Auth Header
Basic auth expects a base64-encodedusername:password pair. A common mistake is encoding only the username, or omitting the colon when the password is empty.
How to Fix It
Confirm the credential type matches what the endpoint accepts, using the table above. Check the Service Account’s role at Project Settings → Service Accounts. It must be Owner or Admin for/import.
Verify your project’s residency and send to the matching host.