Skip to main content
Resend Docs

Search documentation

Type to search this documentation.

Create a new API key

POST/api-keysCreate a new API key

Request body

application/json
objectCreateApiKeyRequest
domain_idstring

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

namestringrequired

The API key name.

permissionstring

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.

one of "full_access", "sending_access"

Example request
{
  "domain_id": "string",
  "name": "string",
  "permission": "full_access"
}

Responses

201OKapplication/json
objectCreateApiKeyResponse
idstring

The ID of the API key.

tokenstring

The token of the API key.

Example response
{
  "id": "string",
  "token": "string"
}
Documentation menu