Overview
Manifest supports multiple email providers for sending notification alerts. You can configure Mailgun, Resend, or SendGrid as your delivery service.Get Email Provider Configuration
Retrieve your current email provider configuration. API keys are never returned — only a prefix for verification.Response Fields
Whether an email provider is configured. If
false, all other fields are omitted.The configured provider:
mailgun, resend, or sendgridDomain used for sending (Mailgun only). For other providers, this is
null.First 8 characters of the API key for verification (e.g.,
sk-live_)Whether the provider is active and ready to send emails
Email address where notifications are sent. If
null, falls back to user’s account email.Example Request
Example Response (Configured)
Example Response (Not Configured)
Configure Email Provider
Set up or update your email provider configuration. API keys are stored encrypted using AES-256-GCM.Request Body
API key from your provider. Required when creating a new configuration. Optional when updating an existing one (provider/domain can be changed without resupplying the key).Minimum length: 8 characters
Required for Mailgun only. Your verified sending domain (e.g.,
mg.company.com). Ignored for other providers.Email address where alerts should be sent. If omitted, notifications go to your account email.
Example Request (Resend)
Example Request (Mailgun)
Example Response
Test Email Provider
Test an email provider configuration before saving it. Sends a test email to verify credentials.Request Body
Provider to test:
resend, mailgun, or sendgridAPI key to test
Domain to test (Mailgun only)
Email address to send the test message to
Example Request
Example Response (Success)
Example Response (Failure)
Test Saved Configuration
Send a test email using your saved provider configuration.Request Body
Email address to send the test message to
Example Request
Example Response
Delete Email Provider
Remove your email provider configuration. Existing notification rules remain but will not send emails.Example Request
Example Response
Get Notification Email
Retrieve the email address configured for receiving notifications.Response Fields
The configured notification email address, or
null if not setExample Request
Example Response
Set Notification Email
Update the email address where notifications are sent.Request Body
Valid email address. Will be normalized to lowercase.
Example Request
Example Response
Provider Setup Guides
Resend (Recommended)
Resend offers the simplest setup with generous free tier:- Sign up at resend.com
- Navigate to API Keys in the dashboard
- Click Create API Key
- Copy the key (starts with
re_) - Use it in the configuration:
Mailgun
Mailgun requires domain verification:- Sign up at mailgun.com
- Go to Sending → Domains
- Add and verify your domain (DNS records required)
- Navigate to API Keys and copy your private API key
- Use both domain and key:
SendGrid
SendGrid offers high deliverability:- Sign up at sendgrid.com
- Go to Settings → API Keys
- Click Create API Key
- Select Full Access or Mail Send permission
- Copy the key (starts with
SG.) - Use it in the configuration:
Email Content
Notification emails include:- Subject: Agent name and threshold type
- Body:
- Agent name
- Metric type (tokens or cost)
- Current usage
- Threshold value
- Time period
- Timestamp of alert
- Link to agent dashboard
- For Mailgun:
noreply@{your-domain} - For others:
[email protected](orNOTIFICATION_FROM_EMAILenv var)
Security
API Key Storage
API keys are encrypted before storage:- Algorithm: AES-256-GCM
- Key derivation: From
BETTER_AUTH_SECRETenvironment variable - Storage:
email_provider_configs.api_key_encryptedcolumn
Key Rotation
To rotate your provider API key:- Generate a new key in your provider dashboard
- POST to
/api/v1/notifications/email-providerwith the newapiKey - The old key is immediately replaced
- Test with
/api/v1/notifications/email-provider/test-saved
Access Control
Email provider configurations are user-scoped. Each user can only:- View their own configuration
- Update their own configuration
- Delete their own configuration
Troubleshooting
Test Email Not Received
- Check spam/junk folder
- Verify domain is properly configured (Mailgun)
- Check provider dashboard for delivery logs
- Ensure API key has send permissions
- Test with
/api/v1/notifications/email-provider/test-saved
”Provider returned failure”
- Resend: Check API key is active and not expired
- Mailgun: Verify domain DNS records are correct
- SendGrid: Ensure API key has Mail Send permission
”Invalid API key”
- API key format is incorrect for the provider
- Key was revoked in provider dashboard
- Wrong provider selected
Notifications Not Sending
- Verify provider is configured:
GET /api/v1/notifications/email-provider - Check
is_activeistrue - Ensure notification rules have
actionofnotifyorboth - Verify
notificationEmailis set or user has account email - Check backend logs for cron job execution
Rate Limits
Provider rate limits vary:| Provider | Free Tier Limit | Recommended Max Rules |
|---|---|---|
| Resend | 100/day | 10 |
| Mailgun | 5,000/3mo | 50 |
| SendGrid | 100/day | 10 |
Notes
- Only one provider can be active at a time
- Changing providers does not affect existing notification rules
- Deleting the provider configuration does not delete notification rules
- Email templates are rendered using
@react-email/render - All email addresses are normalized to lowercase before storage
- The
domainparameter is required for Mailgun, ignored for others