Ariadocs

OpenAPI.Operation

Edit on GitHub

One endpoint.

With only an id, you get the full page: the title, the method and URL, the description, then authorization, parameters, body and responses, with request and response examples beside them. This is Resend's POST /emails:

Preview

Emails

Send an email

POSThttps://api.resend.com/emails
Authorizationheaderrequired

Bearer authentication: Bearer <token>.

A unique identifier for the request to ensure emails are only sent once. Learn more

≤ 256 length

Body

application/jsonoptional
fromstringrequired

Sender email address. To include a friendly name, use the format "Your Name <sender@domain.com>".

tostring | string[]required

Recipient email address. For multiple addresses, send as an array of strings. Max 50.

subjectstringrequired

Email subject.

bccstring | string[]

Bcc recipient email address. For multiple addresses, send as an array of strings.

ccstring | string[]

Cc recipient email address. For multiple addresses, send as an array of strings.

reply_tostring | string[]

Reply-to email address. For multiple addresses, send as an array of strings.

htmlstring

The HTML version of the message.

textstring

The plain text version of the message.

templateobject
headersobject

Custom headers to add to the email.

scheduled_atstring

Schedule email to be sent later. The date should be in ISO 8601 format.

attachmentsAttachment[]
tagsTag[]
topic_idstring

The topic ID to scope the email to. If the recipient is a contact and opted-in to the topic, the email is sent. If opted-out, the email is not sent. If the recipient is not a contact, the email is sent if the topic's default subscription is opt_in.

200

OK

curl -X POST 'https://api.resend.com/emails' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "string",
  "to": "string",
  "subject": "string",
  "bcc": "string",
  "cc": "string",
  "reply_to": "string",
  "html": "string",
  "text": "string",
  "template": {
    "id": "string",
    "variables": {
      "variableName": "Sign up now",
      "variableName2": 123
    }
  },
  "headers": {},
  "scheduled_at": "string",
  "attachments": [
    {
      "content": "<binary>",
      "filename": "string",
      "path": "string",
      "content_type": "string",
      "content_id": "string"
    }
  ],
  "tags": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "topic_id": "string"
}'
Response
{
  "id": "string"
}
<OpenAPI.Root api={api}>
  <OpenAPI.Operation id="emails-send" />
</OpenAPI.Root>

Choosing the parts

Pass children to show only some parts, in your own order. Each part reads the endpoint from the Operation around it.

Preview

Retrieve a single email

GEThttps://api.resend.com/emails/{email_id}
email_idstringrequired

The ID of the email.

<OpenAPI.Operation id="emails-get">
  <OpenAPI.Operation.Title level={3} />
  <OpenAPI.Operation.Header />
  <OpenAPI.Operation.Parameters />
</OpenAPI.Operation>
PartShows
.TagThe endpoint's tag, above the title
.TitleThe summary as a heading
.HeaderThe method, the full URL and a copy button
.DescriptionThe description
.SecurityHow to authenticate
.ParametersPath, query, header and cookie parameters
.RequestBodyThe request body fields
.ResponsesOne row per status code
.RequestExampleCode samples in cURL, JavaScript and Python
.ResponseExampleAn example response for each status code

Props

PropWhat it does
idThe endpoint to show, by id or operationId
operationThe endpoint object, if you already have it
headingLevel1, 2 or 3. Use 1 when the endpoint is the whole page.