Emails
Start sending emails through the Resend API.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /emails | Retrieve a list of emails |
POST | /emails | Send an email |
GET | /emails/{email_id} | Retrieve a single email |
PATCH | /emails/{email_id} | Update a single email |
POST | /emails/{email_id}/cancel | Cancel the schedule of the e-mail. |
POST | /emails/{email_id}/share | Create a shareable link for a sent or received email. |
POST | /emails/batch | Trigger up to 100 batch emails at once. |
GET | /emails/{email_id}/attachments | Retrieve a list of attachments for a sent email |
GET | /emails/{email_id}/attachments/{attachment_id} | Retrieve a single attachment for a sent email |
GET | /emails/metrics | Retrieve account-level email metrics |
Example
Retrieve a list of emails, with the TypeScript SDK:
ts
import { Resend } from "@octridev/resend";
const client = new Resend({
// Optional: replaces the default server and any server an operation declares.
baseUrl: "https://api.resend.com",
auth: { bearerAuth: process.env.API_TOKEN! },
});
const result = await client.emails.list();
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.