Why do my requests return 401 in production?
401 / invalid-token errors almost always mean credentials are mismatched across environments.
401 / invalid-token errors almost always mean credentials are mismatched across environments.
A blanket 401 means the dev-id and x-api-key pair don't match a valid account. When moving from testing to production:
Update both headers.
Ensure both come from the same dashboard account.
Confirm the production
dev-idmatches what's under your dashboard API settings.
An invalid-token error on SDK connection means the auth token was generated for a different environment than the dev-id used at SDK init. Generate the token with the same dev-id (e.g. staging) you pass when initialising the SDK.
See understanding Terra environments for more.
Last updated
Was this helpful?