API Keys
API keys authenticate your requests to the Lettr API.Creating API Keys
Create keys in the dashboard or via API:Key Format
Lettr API keys follow this format:le_prefix identifies it as a Lettr key- 36 character random string
Using API Keys
In Headers (Recommended)
In SDKs
Key Types
| Type | Use Case | Dashboard |
|---|---|---|
| Full Access | Server-side applications | ✅ |
| Restricted | Limited permissions | ✅ |
| Test | Development/testing | ✅ |
Test vs Production Keys
| Feature | Test Key | Production Key |
|---|---|---|
| Prefix | le_test_ | le_ |
| Sends real emails | ❌ | ✅ |
| Rate limits | Lower | Standard |
| Analytics | Limited | Full |
Best Practices
Never expose keys in client-side code
Never expose keys in client-side code
API keys should only be used server-side. Never include them in frontend JavaScript.
Use environment variables
Use environment variables
Store keys in environment variables, not in code.
Rotate keys regularly
Rotate keys regularly
Create new keys and retire old ones periodically.
Use restricted permissions
Use restricted permissions
Only grant the permissions each key needs.