Solution skill
SendGrid API key rotation without downtime
Complete solution
Shows how to fix sendGrid API key rotation without downtime. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Delete the old key in the console. Goal: fresh credentials with no failed sends during the switch.
Steps
- 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.
When to use
You are seeing this: Inventory where the key is used: apps, workers, CI secrets, third-party integrations. Use this skill when you run into "SendGrid API key rotation without downtime".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
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 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
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>