Keys / Twilio SendGrid

SENDGRID_API_KEY

The SendGrid API key your app sends email with. It has full access unless you choose custom permissions.

Starts with
SG.
Expires
no expiry setting
API
create, update and delete, with a key that has the API Keys permission

Get it

Create one on app.sendgrid.com/settings/api_keys. The steps aren't recorded yet.

Set it

SENDGRID_API_KEY=SG....

The Python SDK reads it from this variable when you don't pass a key. The other official SDKs don't; your app passes the key in. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Create a new key with the same permissions as the old one.
  2. Deploy it everywhere that reads SENDGRID_API_KEY.
  3. Check that nothing still uses the old key, then delete it. SendGrid rejects calls with a deleted key.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16