Skip to main content
Every Polar API request carries a bearer token in the Authorization header. Which token you use depends on whose data you’re acting on.
A token can act on your organization’s data within its scopes. Keep tokens on your server or in a secret store. Never put them in client-side code or commit them.

Send a token

Pass the token as a bearer token. The SDKs do this for you:
Tokens belong to one environment. A sandbox token only works against https://sandbox-api.polar.sh, and a production token only against https://api.polar.sh. See Sandbox. Create an organization access token under Settings → Access Tokens in the dashboard, or from the terminal with polar auth token. See Access tokens.

Leaked tokens

Polar is part of the GitHub Secret Scanning Program. When GitHub finds a Polar token in a public repository or discussion, Polar is notified and revokes the token immediately. If you received an email about a leaked token, that’s what happened. The email says which token leaked and where it was found. Create a new token, update your application and check the source of the leak. The OWASP Secrets Management Cheat Sheet covers good practices for storing secrets.

Learn more