Skip to main content
OwnPay authenticates every API request via a Bearer token in the Authorization header. You generate API keys from the admin panel - see API keys for the full key management guide.

How to get an API key

  1. Log in to your OwnPay admin panel
  2. Navigate to Developers → API Keys
  3. Click Generate API Key
  4. Choose the access scope (read, write, or admin)
  5. Copy the key immediately - it is shown only once
Store API keys in environment variables. Never commit them to version control.

Header format

Every API request must include the key as a Bearer token:
The key prefix op_live_ identifies a live key. Test-mode keys use the op_test_ prefix.

Key scopes

API keys carry one of three scopes, which determine which endpoints the key can access:
The scope is set when you generate the key and cannot be changed afterward. Create separate keys for separate applications.

Super admin operations

A small set of platform-level operations (creating brands, managing system users) require an additional header on top of an admin-scoped key:
Only the super admin email registered during installation can use this header. Without it, admin-scoped endpoints return a 403.

Authentication error response

If the key is missing, invalid, expired, or lacks the required scope, the API returns:
Common auth error codes:

Code examples

Best practices

  • Rotate keys every 90 days
  • Use one key per environment (dev, staging, prod)
  • Use one key per application
  • Monitor usage in Developers → API Keys for anomalies
  • Revoke unused keys immediately
Last modified on August 25, 2026