To authenticate with the OptiPub API, you need an API key. Keys are created inside the OptiPub platform and inherit the permissions of the user that created them.
Create a Key
- Log in to your OptiPub account.
- Navigate to Settings > API Keys.
- Click Create API Key.
- Give the key a descriptive name (e.g. "Production Integration" or "Staging Scripts").
- Click Save.
Your API key is displayed only once at creation time. Copy it immediately and store it securely. If you lose it, you'll need to generate a new one.
Use Your Key
Include the key in the Authorization header of every request:
curl -X GET "https://{APP_DOMAIN}/api/3.2/publications" \
-H "Authorization: Bearer YOUR_API_KEY"| Header | Format |
|---|---|
Authorization | Bearer YOUR_API_KEY |
Permissions
Your API key inherits the permissions of the user account that created it. To restrict what an integration can access:
- Create a dedicated user account with limited permissions.
- Generate the API key from that account.
This ensures the key can only perform the actions you intend.
Revoke a Key
To revoke an API key:
- Go to Settings > API Keys.
- Find the key you want to remove.
- Click Delete.
Revoked keys stop working immediately. Any integrations using the key will begin receiving
401 Unauthorizedresponses.

