Skip to main content
API keys are used to authenticate your applications with Gately. There are two types of keys for different use cases.
Testing the API? Once you have an API key, you can test any endpoint directly in our docs using the interactive playground on each API page.

API Key Types

Never expose secret keys (gately_sk_) in client-side code. Use public keys for browser applications and secret keys only on the server.

Creating API Keys

Via Dashboard

  1. Navigate to Settings → API Keys in your Gately dashboard
  2. Click Create API Key
  3. Choose the key type:
    • Public Key - For frontend/browser applications
    • Secret Key - For backend/server applications
  4. Enter a descriptive name (e.g., “Production Frontend”, “Backend API”)
  5. Click Create
  6. Copy the key immediately - it won’t be shown again
After creating your API key, head to any API endpoint page (like List Members) and use the playground to test it!

API Key Format

Public Key

Secret Key

Usage Examples

Browser / Client-Side (Public Key)

React

CDN / Script Tag

Node.js / Server-Side (Secret Key)

REST API (Secret Key)

Python

Permissions

Secret API keys can be scoped to specific permissions: Public keys have limited permissions by default (authentication and user profile access).

Managing API Keys

List All Keys

Response:

Revoke a Key

Environment Variables

Store your API keys in environment variables:

Security Best Practices

1

Use the Right Key Type

Use public keys (gately_pk_) for frontend apps and secret keys (gately_sk_) for backend only.
2

Never Expose Secret Keys

Secret keys should never appear in frontend code, mobile apps, or public repositories.
3

Use Environment Variables

Store API keys in environment variables or a secrets manager, not in source code.
4

Rotate Regularly

Create new keys and revoke old ones periodically, especially after team member departures.
5

Use Minimal Permissions

Create secret keys with only the permissions needed for their specific use case.
6

Monitor Usage

Review API key usage in your dashboard to detect unauthorized access.

Rate Limits

API keys are subject to rate limiting:

Troubleshooting

  • Verify the API key is correct and not revoked
  • Check that you’re using the right key type for your environment
  • Ensure the Authorization header format is correct: Bearer YOUR_KEY
  • The API key doesn’t have permission for this action
  • Public keys have limited permissions - use a secret key for admin operations
  • Create a new key with the required permissions
  • You’ve exceeded the rate limit
  • Wait for the reset time or upgrade your plan
  • Ensure your key starts with gately_pk_ or gately_sk_
  • Check for extra spaces or characters when copying