Create API Key
Create a new API key for the organization. The full token is only returned once at creation time.
POST
/api-keysResend Compatibility: Compatible
Requires a full_access API key.
Body Parameters
namestringrequiredA descriptive name for the API key.
permissionstringPermission level: full_access or sending_access. Default full_access.
full_access— can access all API endpointssending_access— can only send emails
Response Fields
idstringThe API key ID.
tokenstringThe 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
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"token": "re_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}