Templates API is currently in private beta and only available to a limited
number of users.
Path Parameters
The ID or alias of the template to get.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
await resend.templates.get('34a080c9-b17d-4187-ad80-5af20266e535');
{
"object": "template",
"id": "34a080c9-b17d-4187-ad80-5af20266e535",
"alias": "reset-password",
"name": "reset-password",
"created_at": "2023-10-06T23:47:56.678Z",
"updated_at": "2023-10-06T23:47:56.678Z",
"status": "published",
"published_at": "2023-10-06T23:47:56.678Z",
"from": "John Doe <john.doe@example.com>",
"subject": "Hello, world!",
"reply_to": null,
"html": "<h1>Hello, world!</h1>",
"text": "Hello, world!",
"variables": [
{
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
"key": "user_name",
"type": "string",
"fallback_value": "John Doe",
"created_at": "2023-10-06T23:47:56.678Z",
"updated_at": "2023-10-06T23:47:56.678Z"
}
]
}
Get a template by ID.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
await resend.templates.get('34a080c9-b17d-4187-ad80-5af20266e535');
{
"object": "template",
"id": "34a080c9-b17d-4187-ad80-5af20266e535",
"alias": "reset-password",
"name": "reset-password",
"created_at": "2023-10-06T23:47:56.678Z",
"updated_at": "2023-10-06T23:47:56.678Z",
"status": "published",
"published_at": "2023-10-06T23:47:56.678Z",
"from": "John Doe <john.doe@example.com>",
"subject": "Hello, world!",
"reply_to": null,
"html": "<h1>Hello, world!</h1>",
"text": "Hello, world!",
"variables": [
{
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
"key": "user_name",
"type": "string",
"fallback_value": "John Doe",
"created_at": "2023-10-06T23:47:56.678Z",
"updated_at": "2023-10-06T23:47:56.678Z"
}
]
}
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
await resend.templates.get('34a080c9-b17d-4187-ad80-5af20266e535');
{
"object": "template",
"id": "34a080c9-b17d-4187-ad80-5af20266e535",
"alias": "reset-password",
"name": "reset-password",
"created_at": "2023-10-06T23:47:56.678Z",
"updated_at": "2023-10-06T23:47:56.678Z",
"status": "published",
"published_at": "2023-10-06T23:47:56.678Z",
"from": "John Doe <john.doe@example.com>",
"subject": "Hello, world!",
"reply_to": null,
"html": "<h1>Hello, world!</h1>",
"text": "Hello, world!",
"variables": [
{
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
"key": "user_name",
"type": "string",
"fallback_value": "John Doe",
"created_at": "2023-10-06T23:47:56.678Z",
"updated_at": "2023-10-06T23:47:56.678Z"
}
]
}
Was this page helpful?