rembrembdocs

Skip to main content

Resend home pagelight logodark logo

[Documentation

](/docs/introduction)[API Reference

](/docs/api-reference/introduction)[Build with AI

](/docs/ai-onboarding)[Knowledge Base

](/docs/knowledge-base/introduction)[Webhooks

](/docs/webhooks/introduction)

Node.js

import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.apiKeys.create({ name: 'Production' });
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

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

POST

/

api-keys

Node.js

import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.apiKeys.create({ name: 'Production' });
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

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

Documentation Index

Fetch the complete documentation index at: https://resend.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

[​

](#body-parameters)

Body Parameters

[​

](#param-name)

name

string

required

The API key name. Maximum 50 characters.

[​

](#param-permission)

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)

domainId

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.

Was this page helpful?

[

List Logs

Previous

](/docs/api-reference/logs/list-logs)[

List API keys

Next

](/docs/api-reference/api-keys/list-api-keys)

Ctrl+I