Rotate › Resend

# How to rotate a Resend API key

Resend keys never expire and an account can hold many at once, so rotation is create, deploy, check, delete. The parts people get wrong are giving an app a full-access key when it only sends mail, and deleting the old key before every service has stopped using it. Resend's last-used date and Logs page solve the second problem if you know where to look.

Keysquid team · Updated December 2, 2026 · Checked against Resend's documentation on December 2, 2026

**Do this in two minutes, then never again.** Keysquid replaces your Resend key on a schedule, everywhere it's used, and kills a leaked one in seconds. From $9.99 a month. We never see the value.

[Try it free for 7 days](https://keysquid.com/signup)

## How to rotate Resend keys with Keysquid

Automatic Keysquid creates, verifies, distributes and revokes Resend keys on a schedule, with no one in the loop. Sending-access (or full-access) API keys, optionally limited to one domain.

**Setup, as the app shows it:**

1. Create a full-access Resend key for Keysquid only. Your app gets sending-access keys.

- **Writes to:** API key (default variable RESEND_API_KEY), in every platform and secret store you map it to.
- **Interval:** from every 1 hour to every 4 weeks, subject to your plan’s minimum.
- **Inventory:** Keysquid lists every Resend key the connection can see, including keys it doesn’t manage, with names and last use.

Every rotation runs in the same order: create the new key, verify it, write it everywhere, redeploy where a platform needs it, and only then revoke the previous key after a grace period. If any write fails, everything written so far is restored and the new key is revoked. The value is encrypted to the agent you run, so Keysquid’s servers never see it.

What $9.99 a month saves you

One stolen key costs more than a lifetime of Keysquid.

- **$82,314 in 48 hours.** What a stolen Google API key ran up for a 3-person startup that normally spent about $180 a month ([The Register](https://www.theregister.com/2026/03/03/gemini_api_key_82314_dollar_charge/)).
- **$15,400 before the alert landed.** A solo developer revoked a leaked key within minutes of a billing alert, and the charges had already piled up ([TechRadar](https://techradar.com/pro/security/usd15k-bill-destroyed-a-solo-developers-startup-how-hackers-are-using-leaked-google-api-keys-to-go-wild-with-gemini-ai-for-free)).
- **$9.99 a month** for scheduled rotation and a one-click kill switch. **$19.99** adds the Security suite: spend guard, leak scanning, breach alerts, blast radius and compliance packs. Cancel any time.

[Start your 7-day free trial](https://keysquid.com/signup)No card needed to look around. Your keys stay encrypted to an agent you run.

## Under the hood: Resend keys in detail

Everything below is what Keysquid handles for you on every rotation. It’s here so you know exactly what happens to your keys, and in case you ever need to do a step by hand.

- **Where**: Dashboard → **API Keys** (resend.com/api-keys) → **Create API Key**. Name (up to 50 characters), permission, optional domain.
- **Shown once**: Resend shows the key value only at creation. It can't be viewed again afterwards, only replaced.
- **Permissions**: `full_access` (every resource) or `sending_access` (send email only). Sending access can be limited to one domain.
- **Overlap**: Yes: keys are independent, so old and new both work until you delete the old one.
- **Expiry**: None. Resend keys stay valid until deleted. Resend suggests rotating at least every 90 days.
- **Usage**: The API Keys page shows when each key was last used; the API returns `last_used_at`. Logs can be filtered by key.
- **Format**: Keys start with `re_` and are sent as `Authorization: Bearer re_...`.
- **Keysquid**: Automatic: sending-access keys by default, optionally limited to one domain, and the old key deleted.

## Sending access or full access?

Resend has two permission levels and nothing in between. Most apps only call the send endpoint, so the replacement key should almost always be sending access, even if the key you’re replacing was full access. Your code doesn’t change: both kinds authenticate the same way.

| Permission | What it can do | Use it for |
| --- | --- | --- |
| Sending access, one domain | Send email only, and only from the one domain you pick | Production apps. One key per service and domain. |
| Sending access, all domains | Send email from any verified domain on the account | An app that sends from several domains |
| Full access | Create, read, update and delete any resource: domains, contacts, API keys, webhooks | Only the tool that manages keys or domains |

Permission levels as described in Resend's API reference and dashboard docs. The domain limit is only available on sending-access keys.

Resend’s own leaked-key guide gives the practical reason: a sending-only key can’t read your contacts. A full-access key in an app server means a leak exposes your audience lists and lets the holder create new keys that survive your rotation.

**You can edit a key’s permission in the dashboard** (**More options → Edit API key**). That’s fine for tightening a key you trust. It’s not a substitute for rotation: if the value may have been seen, downgrading it still leaves a working key in someone else’s hands.

## Rotate a key in the Resend dashboard

1. Open **API Keys** and note the old key’s name, permission and domain. Match them (or narrow them) on the new key.
2. Click **Create API Key**. Give it a name that says which service and when, for example `web-app 2026-12`.
3. Choose **Sending access** and, if the service sends from one domain, pick that domain.
4. Copy the key into your secret store straight away. Resend won’t show it again.
5. Replace `RESEND_API_KEY` in every environment that uses the old key and redeploy.
6. Send a test email, then open **Logs**, filter by the new key and confirm requests are arriving.
7. Wait until the old key’s last-used time stops moving, then delete it: **More options → Remove API key**.

Step 7 is the one that saves you. Because Resend keys never expire, it’s common to find one key shared by a web app, a cron job and a preview environment nobody remembers. If the old key is still being used an hour after you deployed, something you didn’t update is still sending with it. Filter Logs by the old key to see the request and its User-Agent, which usually names the SDK and points to the service.

## Rotate a key with the API

The API Keys endpoints need a full-access key. Keep that key out of your apps; use it only from the machine or tool that rotates.

```bash
# 1. Create a sending-access key limited to one domain
curl -s https://api.resend.com/api-keys \
  -H "Authorization: Bearer $RESEND_ADMIN_KEY" -H "Content-Type: application/json" \
  -d '{"name":"web-app 2026-12","permission":"sending_access","domain_id":"'"$DOMAIN_ID"'"}' | jq -r '.id, .token'

# 2. Deploy the new token, send a test, then check when the old key was last used
curl -s https://api.resend.com/api-keys -H "Authorization: Bearer $RESEND_ADMIN_KEY" \
  | jq '.data[] | {id, name, created_at, last_used_at}'

# 3. Delete the old key once last_used_at stops changing
curl -s -X DELETE "https://api.resend.com/api-keys/$OLD_KEY_ID" -H "Authorization: Bearer $RESEND_ADMIN_KEY"
```

A successful delete returns `{"object":"api_key","id":"...","deleted":true}`. The list endpoint returns every key in one response unless you pass `limit` (1 to 100) with `after` or `before` for paging. The API can rename a key but can’t change its permission or domain; that’s a dashboard-only edit. The `domain_id` is the ID of a verified domain from the Domains API, not the domain name.

## If a Resend key leaked

1. **Delete the key first.** Resend says deletion revokes it immediately. Then create a replacement and deploy it; a short gap in sending is better than mail sent in your name.
2. Open **Logs**, filter by the leaked key and the time window, and check the **Emails** page for messages you didn’t send. Resend keeps 30 days of activity and logs full request bodies, but not source IP addresses.
3. If it was a full-access key, look for API keys, webhooks or domains you didn’t create and remove them.
4. Watch **Metrics** for a few weeks. Resend may pause sending if bounces go above 4% or spam complaints above 0.08%.
5. Find where it leaked using [the first 10 minutes after a key leak](https://keysquid.com/blog/leaked-api-key-first-10-minutes), and check your site with the [website leak scanner](https://keysquid.com/tools/website-leak-scanner).

## By hand vs. with Keysquid

### By hand

1. Create a key with the right permission and domain, and copy it once.
2. Update every environment that uses it.
3. Watch the old key’s last-used time, then delete it.
4. Remember to do it again in 90 days, because the key never expires.

### With Keysquid

1. Keysquid creates a sending-access key, limited to the domain you set.
2. It writes the key to every platform you mapped and redeploys.
3. It deletes the old key after the grace period.
4. It lists every key on the account with its last-used date, so stray keys stand out.

## What Keysquid does on every rotation

You give Keysquid one full-access key, used only to create, list and delete keys. Your apps get sending-access keys, optionally limited to one domain ID, on the schedule you set. Because Resend has no expiry of its own, a schedule is the only thing that stops a key living for years. Keysquid can’t change a key’s permission after creation (the API doesn’t allow it) and doesn’t touch webhooks or domains.

What $9.99 a month saves you

One stolen key costs more than a lifetime of Keysquid.

- **$82,314 in 48 hours.** What a stolen Google API key ran up for a 3-person startup that normally spent about $180 a month ([The Register](https://www.theregister.com/2026/03/03/gemini_api_key_82314_dollar_charge/)).
- **$15,400 before the alert landed.** A solo developer revoked a leaked key within minutes of a billing alert, and the charges had already piled up ([TechRadar](https://techradar.com/pro/security/usd15k-bill-destroyed-a-solo-developers-startup-how-hackers-are-using-leaked-google-api-keys-to-go-wild-with-gemini-ai-for-free)).
- **About 20 hours a year** of engineering time to rotate 10 keys by hand every 90 days, at roughly 30 minutes a key. That's around $2,000 at $100 an hour (our estimate).
- **$9.99 a month** for scheduled rotation and a one-click kill switch. **$19.99** adds the Security suite: spend guard, leak scanning, breach alerts, blast radius and compliance packs. Cancel any time.

[Start your 7-day free trial](https://keysquid.com/signup)No card needed to look around. Your keys stay encrypted to an agent you run.

## Frequently asked questions

### Can I rotate a Resend API key without downtime?

Yes. An account can hold several keys and both work at once. Create the new key, deploy it everywhere, confirm it in Logs, and delete the old key only when its last-used time stops changing.

### Do Resend API keys expire?

No. Resend keys stay valid until you delete them. Resend recommends rotating at least every 90 days and deleting keys that haven't been used for 30 days.

### What is the difference between full access and sending access?

Full access can create, read, update and delete any resource, including other API keys. Sending access can only send email, and can be limited to one domain.

### Can I see a Resend API key again after creating it?

No. The value is shown once at creation. If you lose it, create a new key and delete the old one.

### Can I change a key's permission through the API?

No. The API can only rename a key. Permission and domain can be edited in the dashboard, or you can create a new key with the permission you want.

### How do I find which service still uses an old Resend key?

Check the key's last-used time on the API Keys page, then filter Logs by that key. Each request shows the endpoint, time and User-Agent, which usually identifies the SDK and the service.

Rotate keys without ever handing them over

Keysquid rotates and revokes API keys on a schedule and encrypts every value to an agent you run, so we never see a readable key. Flat pricing from $9.99 a month, unlimited team members, 7-day free trial.

[Start 7-day free trial](https://keysquid.com/signup)

[Security model](https://keysquid.com/security)[Docs](https://keysquid.com/docs)

## Related

- [Rotate a SendGrid API key](https://keysquid.com/rotate/sendgrid)
- [Rotate a Mailgun API key](https://keysquid.com/rotate/mailgun)
- [Rotation support for every provider](https://keysquid.com/rotate)
- [Check SPF, DKIM and DMARC for your domain](https://keysquid.com/tools/email-security)
- [OpenAI key rotation](https://keysquid.com/rotate/openai)
- [Anthropic key rotation](https://keysquid.com/rotate/anthropic)

## Sources

1. [Resend docs: Create an API key](https://resend.com/docs/create-an-api-key)
2. [Resend docs: Managing API keys](https://resend.com/docs/dashboard/api-keys)
3. [Resend knowledge base: How to handle API keys](https://resend.com/docs/knowledge-base/how-to-handle-api-keys)
4. [Resend knowledge base: How to handle a leaked API key](https://resend.com/docs/knowledge-base/how-to-handle-a-leaked-api-key)
5. [Resend API: Create API key](https://resend.com/docs/api-reference/api-keys/create-api-key)
6. [Resend API: List API keys](https://resend.com/docs/api-reference/api-keys/list-api-keys)
7. [Resend API: Delete API key](https://resend.com/docs/api-reference/api-keys/delete-api-key)
