Skip to main content

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)
Example Use Cases:
  • 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
Example Use Cases:
  • Signup forms on websites
  • Contact creation from mobile apps
  • Newsletter subscription widgets
  • Lead capture forms

Creating API Keys

  1. Navigate to your Letterby Dashboard
  2. Select your project
  3. Go to the Integrations tab
  4. Click Create key
  5. Choose Private or Public based on your use case
  6. 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

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:
  1. Check your key type and permissions
  2. Ensure your key is active and not expired
  3. Contact support for assistance
Need help choosing the right key type? Private keys for backends, Public keys for frontends!