Documentation Index
Fetch the complete documentation index at: https://docs.letterby.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Letterby uses API key authentication to secure access to our API endpoints. We offer two types of API keys designed for specific use cases, from server-side integrations to client-side applications.API Key Types
Private Keys 🔒
Best for: Server-side applications, backend services, admin operations- Full Access: Complete CRUD operations on all endpoints
- No Restrictions: Can be used from any IP address or domain
- High Security: Must be kept secret and never exposed publicly
- Rate Limits: Managed by Cloudflare (same for all users)
- Backend API integrations
- Server-side contact management
- Automated data synchronization
- Admin dashboard operations
Public Keys 🌐
Best for: Frontend applications, client-side forms, mobile apps- Limited Access: Create contacts only (no read, update, or delete operations)
- Client-Safe: Designed to be safely embedded in frontend code
- No Restrictions: Can be used from any domain or origin
- Signup forms on websites
- Contact creation from mobile apps
- Newsletter subscription widgets
- Lead capture forms
Creating API Keys
- Navigate to your Letterby Dashboard
- Select your project
- Go to the Integrations tab
- Click Create key
- Choose Private or Public based on your use case
- Configure options:
- Key name: Descriptive name for organization
- Expiration: Optional automatic expiration date
Security Best Practices
✅ Do’s
- Use Private keys for server-side applications
- Use Public keys for client-side applications
- Set expiration dates for temporary integrations
- Regenerate keys if compromised
- Use descriptive names for key organization
- Store Private keys securely (environment variables, key management services)
❌ Don’ts
- Never expose Private keys in frontend code
- Don’t hardcode keys in public repositories
- Avoid using Private keys in mobile apps
- Don’t share keys across different applications
- Never log API keys in application logs
Common Error Responses
| Status Code | Error | Description | Solution |
|---|---|---|---|
400 | No API key provided | Missing apiKey header | Add apiKey header to request |
401 | Unauthorized request | Invalid, expired, or inactive key | Check key validity and status |
403 | Insufficient permissions | Public key used for non-POST request | Use Private key or switch to POST request |
429 | Rate limit exceeded | Too many requests | Wait and retry, or upgrade plan |
Key Management
Viewing Keys
In your dashboard, you can see:- Key type (Private/Public)
- Active/inactive status
- Expiration date (if set)
- Creation date
- Last used date
Key Controls
- Toggle: Enable/disable keys instantly
- Edit: Update name and expiration
- Delete: Permanently remove keys
- Copy: Safely copy key values
JavaScript/Frontend Usage
Public keys are perfect for frontend applications:Migration from Legacy Keys
If you have existing API keys created before our security enhancement:- They continue to work with full access (backward compatibility)
- Consider migrating to Private keys for server-side use
- Create new Public keys for client-side applications
- Update your applications to use the new key types
Testing Your Integration
Test with curl (Private Key)
Test with curl (Public Key)
Support
If you encounter issues with API key authentication:- Check your key type and permissions
- Ensure your key is active and not expired
- Contact support for assistance
Need help choosing the right key type? Private keys for backends, Public
keys for frontends!