Back to SendGrid in Excel
SheetXAI logo
SendGrid logo
SendGrid · Excel Guide

Audit and Revoke SendGrid API Keys From an Excel Workbook

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 last quarter, each of whom had SendGrid API keys. 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 with scopes, and you need the stale ones revoked before end of day.

The slow version:

  • Open SendGrid's API Key management page
  • Click through 40 keys, noting names and scopes in the workbook by hand
  • Cross-reference against the former employee list from memory
  • Manually revoke the keys you identify
  • Miss three because they were named after integrations, not employees
  • Find out 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 Excel workbook that lists all your SendGrid API keys and revokes the flagged ones, 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 workbook, 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 and flag the keys to revoke in column D:

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 workbook.

What You Get

A complete API key inventory with three populated columns:

  • Column A — key name as it appears in SendGrid
  • Column B — the API key ID needed for revocation
  • Column C — all scopes (e.g. "mail.send, templates.read, stats.read")

The scopes column makes the risk visible. A key with mail.send and suppressions.write in the wrong hands is a real problem. The inventory surfaces it before the next audit.

What If the Data Is Not Quite Ready

When key names do not clearly map to owners

List all SendGrid API keys and write their names, IDs, and scopes into this workbook. 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 overly broad scopes

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.

When you want to revoke and confirm in one step

For each row where column D says 'revoke', delete the SendGrid API key in column B. Write 'revoked' or the error in column E. Count how many keys were successfully revoked and write the total in cell A1.

When you need the full security sweep in one prompt

List all my SendGrid API keys and write their names, IDs, and scopes into this workbook. Flag any key with 'full_access' in its scopes as 'OVERPERMISSIONED' in column D. For keys where column E says 'revoke', delete them 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: inventory and revocation are one continuous operation. No clicking through 40 UI entries.

Try It

Get the 7-day free trial of SheetXAI and open a blank Excel workbook, 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 Excel or the SendGrid in Excel overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more