SendGrid Integration
Use SendGrid with Frevana by creating a scoped API key for email delivery.
Last updated
Use SendGrid with Frevana by creating a scoped API key for email delivery.
Before you start, make sure you have:
A SendGrid account
A verified sender email in your SendGrid account (link)
Access to the SendGrid dashboard
Permission to manage API keys
To complete the setup, you will need:
A SendGrid API key, a key that starts with SG.
The mail.send permission enabled
Open API key settings
Open SendGrid API Keys.
You can also navigate there from Settings → API Keys in the SendGrid dashboard.
Create a new API key
Click Create API Key.
Enter a recognizable name, for example:
Frevana Mail SendingChoose Custom Access.
Avoid Full Access for production use. A restricted key is safer and easier to manage.
Enable the required permission
In the permissions list, enable for
mail.send (Full Access)
Email Activity (Read Access)
stats.read (Read Access)
Optional permissions:
mail_settings.read
If your requests return 403 Forbidden, verify the key permissions first.

Generate and copy the API key
Click Create & View.
SendGrid will generate a key like this:

SG.xxxxxxxx.yyyyyyyyyyyyyyyyyyyyyThe key is shown only once. Copy and store it before leaving the page.
Send the key back to the Frevana Agent Chat or Save the key as an environment variable
Send the key back to the Frevana Agent Chat, and it is done! or, you can save the key as an environment variable first
Use the full key exactly as shown, including the SG. prefix.
macOS / Linux
export SENDGRID_API_KEY="SG.xxxxxxxx.yyyyyyyyyyyyyyyyyyyyy"Windows PowerShell
setx SENDGRID_API_KEY "SG.xxxxxxxx.yyyyyyyyyyyyyyyyyyyyy"Use the real key you copied from SendGrid. Do not include extra spaces or line breaks.
403 Forbidden
Verify that:
The key uses Restricted Access
The mail.send permission is enabled
You copied the full key correctly
401 Unauthorized
Verify that:
The key has not been deleted
The key has not been rotated
The value still starts with SG.
The key is missing
SendGrid only shows a new key once.
If you did not save it, create a new API key and replace the old one.
Last updated