OpenAPI.Operation
Edit on GitHubOne 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:
Emails
Send an email
https://api.resend.com/emailsAuthorizationheaderrequiredBearer authentication: Bearer <token>.
Idempotency-KeystringA unique identifier for the request to ensure emails are only sent once. Learn more
Body
fromstringrequiredSender email address. To include a friendly name, use the format "Your Name <sender@domain.com>".
tostring | string[]requiredRecipient email address. For multiple addresses, send as an array of strings. Max 50.
subjectstringrequiredEmail 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.
htmlstringThe HTML version of the message.
textstringThe plain text version of the message.
templateobjectheadersobjectCustom headers to add to the email.
scheduled_atstringSchedule email to be sent later. The date should be in ISO 8601 format.
attachmentsAttachment[]tagsTag[]topic_idstringThe 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.
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"
}'{
"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.
Retrieve a single email
https://api.resend.com/emails/{email_id}The ID of the email.
<OpenAPI.Operation id="emails-get">
<OpenAPI.Operation.Title level={3} />
<OpenAPI.Operation.Header />
<OpenAPI.Operation.Parameters />
</OpenAPI.Operation>
| Part | Shows |
|---|---|
.Tag | The endpoint's tag, above the title |
.Title | The summary as a heading |
.Header | The method, the full URL and a copy button |
.Description | The description |
.Security | How to authenticate |
.Parameters | Path, query, header and cookie parameters |
.RequestBody | The request body fields |
.Responses | One row per status code |
.RequestExample | Code samples in cURL, JavaScript and Python |
.ResponseExample | An example response for each status code |
Props
| Prop | What it does |
|---|---|
id | The endpoint to show, by id or operationId |
operation | The endpoint object, if you already have it |
headingLevel | 1, 2 or 3. Use 1 when the endpoint is the whole page. |