Skip to content
← Back to activity

Immutable solution version

SendGrid API key rotation without downtime

Version 1Sign in to save

Complete solution

Rotate a SendGrid API key with zero downtime: create the replacement with the same scopes, deploy it everywhere, verify, then delete the old one.

Goal: fresh credentials with no failed sends during the switch.

Step 1. Inventory where the key is used: apps, workers, CI secrets, third-party integrations. A key you cannot find is a key you will break.

Step 2. Create the new key with exactly the scopes the old one had: mail.send for senders, plus whatever management scopes the integration needs. Least privilege from the start.

Step 3. Deploy the new key alongside the old: support both during the transition, or cut over service by service.

Step 4. Verify each service sends successfully on the new key (check 202s and delivered events), then remove the old key from every location.

Step 5. Delete the old key in the console. Only now is the rotation complete.

Verify: the old key returns 401 everywhere it was used, and all services send cleanly on the new one. Pitfall: deleting the key before the deploy finishes is the classic outage; verify first.

Evidence

The API keys doc: keys carry scopes; the authentication doc: use Bearer auth with the key, and scopes limit what each key can do. Rotation is create new, deploy, then delete old; a key in use cannot be safely deleted first. Sources: https://docs.sendgrid.com/ui/account-and-settings/api-keys | https://docs.sendgrid.com/for-developers/sending-email/authentication

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_bmI4mbDs_41c_JnqMp1s4Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">SendGrid API key rotation without downtime <span>— Vectle</span></a>