The Scenario
You are on a security team. It is Monday morning and you have a list of 12 former employees who left the company in the last quarter. Each of them had SendGrid API keys issued for integration work. The keys were not revoked when they left.
Your organization has 40 active API keys in SendGrid. You do not know which ones belong to the former employees. You need a full inventory of every key with its scopes, and then you need the stale ones revoked before end of day.
The slow version:
- Open SendGrid's API Key management page
- The UI shows key names, not who created them
- Click into each key to see its scopes
- Cross-reference 40 key names against your list of 12 former employees by memory
- Manually revoke the ones you identify
- Miss three because the keys were named after the integration, not the employee. Realize it during next quarter's audit.
The fast version is one prompt.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent inside your spreadsheet that lists all your SendGrid API keys, writes them into the sheet, and then revokes the ones you flag — without you clicking through the UI.
Open the SheetXAI sidebar and type:
List all SendGrid API keys and write each key's name, API key ID, and scopes into this sheet, one row per key. Use column A for the key name, column B for the API key ID, and column C for the scopes (as a comma-separated list).
Once you have the inventory, you flag the keys to revoke in column D, then:
For each row where column D says 'revoke', delete that SendGrid API key using the ID in column B. Write 'revoked' or the error message in column E.
The whole operation is auditable. Every key, every scope, every revocation decision is in the sheet.
What You Get
A complete API key inventory with three populated columns:
- Column A — key name, exactly as it appears in SendGrid
- Column B — the API key ID, needed for revocation
- Column C — all scopes for that key (e.g. "mail.send, templates.read, stats.read")
The scopes column is the most important part. A key with mail.send and suppressions.write can do real damage if it is in the wrong hands. The inventory makes that visible before you have to guess.
After you flag and revoke, column E shows the result for every key you targeted.
What If the Data Is Not Quite Ready
Security audits rarely run on clean, complete data.
When key names do not clearly map to owners
The keys are named "Integration-Production" and "Webhook-Staging" — not employee names.
List all SendGrid API keys and write their names, IDs, and scopes into this sheet. Then check each key name against the names in the Former Employees tab and flag any key name that contains a match as 'REVIEW' in column D.
When you want to flag keys with overly broad scopes
A key with full access should not exist for a one-purpose integration.
List all SendGrid API keys with their scopes. For any key where the scopes include 'full_access' or more than 5 individual scopes, write 'OVERPERMISSIONED' in column D so the team can decide whether to scope it down.
When you want to revoke and confirm in one step
You have already reviewed the list and column D is populated.
For each row where column D says 'revoke', delete the SendGrid API key in column B. Write 'revoked' or the error in column E. Then count how many keys were successfully revoked and write the total at the top of the sheet in cell A1.
When you need the full security sweep: inventory, scope review, revocation, and a summary report
The complete audit in one prompt.
List all my SendGrid API keys and write their names, IDs, and scopes into this sheet. Flag any key with 'full_access' in its scopes as 'OVERPERMISSIONED' in column D. For keys where column E says 'revoke', delete them using the ID in column B and write 'revoked' or the error in column F. Then on a new tab called Security Report, write a summary: total keys audited, how many had full access, how many were revoked, and which keys remain with broad permissions.
The pattern: the inventory and the revocation are one continuous operation. You do not click through 40 entries in the UI.
Try It
Get the 7-day free trial of SheetXAI and open a blank sheet, then ask it to list all your SendGrid API keys with their scopes. The SendGrid integration is included in every SheetXAI plan. For related workflows, see how to audit SendGrid transactional templates from a sheet or the SendGrid in Google Sheets overview.
