Rename an existing API key from the API without regenerating its token.
Today we're introducing PATCH /api-keys/:id to rename an API key in place. The token stays the same, and so do the key's permission and domain restriction.
Send the new name (up to 50 characters) with the ID of the key you want to rename.
import { Resend } from 'resend';const resend = new Resend('re_xxxxxxxxx');const { data, error } = await resend.apiKeys.update('b6d24b8e-af0b-4c3c-be0c-359bbd97381e',{ name: 'Production' },);
The response confirms the rename:
{"object": "api_key","id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"}
This endpoint only updates the name. To change a key's permission or domain restriction, edit the key in the Resend Dashboard.
Renaming keys is also available in the Resend CLI and through the MCP server, so your agents can tidy up key names too.