import { Resend } from 'resend';

const resend = new Resend('re_123456789');

resend.apiKeys.create({ name: 'Production' });
{
  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
  "token": "re_c1tpEyD8_NKFusih9vKVQknRAQfmFcWCv"
}

Body Parameters

name
string
required

The API key name.

permission
full_access | sending_access

The API key can have full access to Resend’s API or be only restricted to send emails. * full_access: Can create, delete, get, and update any resource. * sending_access: Can only send emails.

domain_id
string

Restrict an API key to send emails only from a specific domain. This is only used when the permission is set to sending_access.