Skip to main content

Bearer Token Authentication

All Bouncy.ai API requests require authentication using an API key passed as a Bearer token in the Authorization header of every request.

Getting Your API Key

1

Upgrade to Growth Plan

API access requires a Growth plan or higher ($35/month).
2

Generate an API Key

  1. Go to bouncy.ai/api/dashboard
  2. Click “Create Key”
  3. Give your key a descriptive name
  4. Choose a role: Full Access, Creator, or Viewer (read only)
  5. Copy and save your key securely
3

Store Securely

Never commit API keys to version control or share them publicly. Use environment variables or a secrets manager.

API Key Format

Bouncy.ai API keys follow this format:
  • bcy_ - Bouncy.ai identifier
  • live_ - Production environment
  • pk_ - Private key (keep secret!)
  • 64 characters - Random hex string

Making Authenticated Requests

Include your API key as a Bearer token in the Authorization header:

Using Environment Variables

Recommended: Store your API key in an environment variable:

API Key Roles

Every key gets a role when you create it. The role controls which endpoints the key can call. You can have up to 10 active keys, so you can hand out narrowly scoped keys instead of sharing your main one.
Give third parties a Viewer key. They can pull analytics and read data, but they cannot create or change anything on your account.
The rule of thumb: GET endpoints need read permission for their resource, and everything else needs write permission. GET /v1/account/profile is the exception: it returns account owner details (email, name, billing), so only Full Access keys can call it. Keys created before roles existed keep working unchanged, with full access.

Insufficient permissions error

When a key calls an endpoint outside its role, the API returns 403 Forbidden:
Solution: Use a key whose role includes the required permission, or create a new key with the right role.

Managing API Keys

Viewing Your Keys

View all your API keys in the API Dashboard. You can see:
  • Key name and prefix (e.g., bcy_live_pk_••••)
  • Role (Full Access, Creator, or Viewer)
  • Creation date
  • Last used date
  • Current usage statistics

Revoking Keys

If an API key is compromised:
  1. Go to bouncy.ai/api/dashboard
  2. Find the compromised key
  3. Click “Revoke”
  4. Create a new key immediately
  5. Update your applications with the new key
Revoked keys stop working immediately and cannot be restored. All requests using a revoked key will return a 401 Unauthorized error.

Security Best Practices

Use .gitignore to exclude files containing API keys:
Store API keys in environment variables, not in your code:
Create new API keys every 90 days and revoke old ones. This limits exposure if a key is compromised.
Create different API keys for development, staging, and production. This makes it easier to revoke a specific environment’s access.
Create a Viewer key for read-only integrations and reporting tools. If that key ever leaks, it cannot be used to create or change anything on your account.

Authentication Errors

401 Unauthorized - Missing API Key

Solution: Include your API key as a Bearer token in the Authorization header.

401 Unauthorized - Invalid API Key

Solutions:
  • Check that you’ve copied the full API key
  • Verify the key hasn’t been revoked
  • Generate a new API key if needed

403 Forbidden - Plan Upgrade Required

Solution: Upgrade to a Growth plan or higher ($35/month).

Rate Limits

Rate limits are enforced per API key: When you exceed a limit, the API returns 429 Too Many Requests with a message explaining which limit you hit and when it resets. See the Error Handling Guide for more details on rate limiting.