Creating an API Key

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

  1. Log in to your OptiPub account.
  2. Navigate to Settings > API Keys.
  3. Click Create API Key.
  4. Give the key a descriptive name (e.g. "Production Integration" or "Staging Scripts").
  5. 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"
HeaderFormat
AuthorizationBearer YOUR_API_KEY

Permissions

Your API key inherits the permissions of the user account that created it. To restrict what an integration can access:

  1. Create a dedicated user account with limited permissions.
  2. 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:

  1. Go to Settings > API Keys.
  2. Find the key you want to remove.
  3. Click Delete.

Revoked keys stop working immediately. Any integrations using the key will begin receiving 401 Unauthorized responses.