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
| Key Type | Prefix | Usage | Security |
|---|---|---|---|
| Public Key | gately_pk_ | Browser/client-side apps | Safe to expose in frontend code |
| Secret Key | gately_sk_ | Server-side only | Never expose publicly |
Creating API Keys
Via Dashboard
- Navigate to Settings → API Keys in your Gately dashboard
- Click Create API Key
- Choose the key type:
- Public Key - For frontend/browser applications
- Secret Key - For backend/server applications
- Enter a descriptive name (e.g., “Production Frontend”, “Backend API”)
- Click Create
- Copy the key immediately - it won’t be shown again
API Key Format
Public Key
Secret Key
| Part | Description |
|---|---|
gately | Prefix identifying Gately keys |
pk / sk | Public key / Secret key |
live | Environment (live or test) |
xxxx... | Unique key identifier |
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:| Permission | Description |
|---|---|
read:members | View member data |
write:members | Create, update, delete members |
read:forms | View forms and submissions |
write:forms | Create and manage forms |
read:content | View protected content |
write:content | Manage protected content |
admin | Full access to all resources |
Managing API Keys
List All Keys
Revoke a Key
Environment Variables
Store your API keys in environment variables:Security Best Practices
Use the Right Key Type
Use public keys (
gately_pk_) for frontend apps and secret keys (gately_sk_) for backend only.Never Expose Secret Keys
Secret keys should never appear in frontend code, mobile apps, or public repositories.
Use Environment Variables
Store API keys in environment variables or a secrets manager, not in source code.
Rotate Regularly
Create new keys and revoke old ones periodically, especially after team member departures.
Use Minimal Permissions
Create secret keys with only the permissions needed for their specific use case.
Rate Limits
API keys are subject to rate limiting:| Plan | Requests/Minute |
|---|---|
| Free | 60 |
| Pro | 300 |
| Business | 1000 |
| Enterprise | Custom |
Troubleshooting
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
- 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
429 Rate Limited
429 Rate Limited
- You’ve exceeded the rate limit
- Wait for the reset time or upgrade your plan
Invalid API Key Format
Invalid API Key Format
- Ensure your key starts with
gately_pk_orgately_sk_ - Check for extra spaces or characters when copying
