Skip to main content
A 401 means Mixpanel could not authenticate the request. The credentials were missing, malformed, or not valid for the project you addressed.

What the Response Looks Like

Which Credentials Each Endpoint Accepts

A bad project token on /track does not produce a 401. The endpoint returns 200 with a body of 1, which confirms the payload was well-formed but says nothing about whether the token is valid. 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 authenticates but is not permitted to import.

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. Sending correct credentials to the wrong host fails, because the project does not exist there. See EU Residency and India Residency.

Malformed Basic Auth Header

Basic auth expects a base64-encoded username: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.