Authentication Print

  • api authentication, bearer token, api token, scopes, token rotation, authorization header
  • 0

Medusa Panel › Account

The REST API authenticates with a token sent in the Authorization header. Each account can hold its own API token, and a deployment token is available for trusted full-administrator automation.

Create an account token

Open your account under Medusa Panel › Account. In the API token section, Generate a token (Rotate replaces the current one, Delete revokes it). The panel tracks how many API requests the token has made and when it was last used.

Send the token

Put the token in the Authorization header, prefixed with Token :

# list streams
curl -H "Authorization: Token YOUR_TOKEN" 
  https://panel.example.com/api/v1/streams

Deployment token

The engine can also accept a fixed token set in the MEDUSA_API_TOKEN environment variable. It always acts as a full administrator, so use it only for server-to-server automation you control — never in a browser or a client app.

Scope

A token acts as the account it belongs to. A reseller token sees and changes only that reseller’s subscribers — see Sub-resellers and API. Give each integration its own account and token so you can revoke one without breaking the rest.

Repeated bad tokens from one address are rate-limited: after about 10 failures in 60 seconds the API locks that IP briefly and returns 429 Too Many Requests with a Retry-After header. Back off and wait rather than retrying at once.
A token is a credential. Send it only over HTTPS, keep it out of logs and client-side code, and rotate it immediately if it may have leaked.

Related


Was this answer helpful?

« Back