Delete API Key

Delete an API key by ID. You cannot delete the API key that is currently being used for authentication.

DELETE/api-keys/{api_key_id}

Resend Compatibility: Compatible

Requires an API key with api_keys:write permission.

Path Parameters

api_key_idstringrequired

The ID of the API key to delete.

Response Fields

objectstring

Always "api_key".

idstring

The API key ID.

deletedboolean

Always true.

curl -X DELETE 'https://api.postflare.dev/api-keys/a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
  -H 'Authorization: Bearer sk_xxxxxxxxx'
// Set RESEND_BASE_URL=https://api.postflare.dev in the environment before
// the process starts. Without it the SDK sends to api.resend.com, silently.
import { Resend } from 'resend';

const resend = new Resend('sk_xxxxxxxxx');

const { data, error } = await resend.apiKeys.remove(
  'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
);

Response

Response
{
  "object": "api_key",
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "deleted": true
}