Templates
Create and manage Templates through the Resend API.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /templates | Retrieve a list of templates |
POST | /templates | Create a template |
GET | /templates/{id} | Retrieve a single template |
PATCH | /templates/{id} | Update an existing template |
DELETE | /templates/{id} | Remove an existing template |
POST | /templates/{id}/publish | Publish a template |
POST | /templates/{id}/duplicate | Duplicate a template |
Example
Retrieve a list of templates, 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.templates.list();
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.