Create API Key

Create a new API key for the organization. The full token is only returned once at creation time.

POST/api-keys

Resend Compatibility: Compatible

Requires a full_access API key.

Body Parameters

namestringrequired

A descriptive name for the API key.

permissionstring

Permission level: full_access or sending_access. Default full_access.

  • full_access — can access all API endpoints
  • sending_access — can only send emails

Response Fields

idstring

The API key ID.

tokenstring

The full API key token (e.g. re_xxxxxxxxx). Store this securely — it cannot be retrieved again.

curl -X POST 'https://api.postflare.app/api-keys' \
  -H 'Authorization: Bearer re_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Production Key",
    "permission": "full_access"
  }'
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.apiKeys.create({
  name: 'Production Key',
  permission: 'full_access',
});

Response

Response
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "token": "re_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}