Skip to main content
GET
/
templates
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

await resend.templates.list({
  limit: 2,
  after: '34a080c9-b17d-4187-ad80-5af20266e535',
});
{
  "object": "list",
  "data": [
    {
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "name": "reset-password",
      "status": "draft",
      "published_at": null,
      "created_at": "2023-10-06T23:47:56.678Z",
      "updated_at": "2023-10-06T23:47:56.678Z",
      "alias": "reset-password"
    },
    {
      "id": "b7f9c2e1-1234-4abc-9def-567890abcdef",
      "name": "welcome-message",
      "status": "published",
      "published_at": "2023-10-06T23:47:56.678Z",
      "created_at": "2023-10-06T23:47:56.678Z",
      "updated_at": "2023-10-06T23:47:56.678Z",
      "alias": "welcome-message"
    }
  ],
  "has_more": false
}
By default, the API will return the most recent 20 templates. You can optionally use the limit parameter to return a different number of templates or control the pagination of the results with the after or before parameters.
Templates API is currently in private beta and only available to a limited number of users.

Query Parameters

limit
number
The number of templates to return. Defaults to 20. Maximum is 100.
after
string
The ID of the template to start after. The API will return the templates after (and not including) the given ID.
before
string
The ID of the template to start before. The API will return the templates before (and not including) the given ID.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

await resend.templates.list({
  limit: 2,
  after: '34a080c9-b17d-4187-ad80-5af20266e535',
});
{
  "object": "list",
  "data": [
    {
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "name": "reset-password",
      "status": "draft",
      "published_at": null,
      "created_at": "2023-10-06T23:47:56.678Z",
      "updated_at": "2023-10-06T23:47:56.678Z",
      "alias": "reset-password"
    },
    {
      "id": "b7f9c2e1-1234-4abc-9def-567890abcdef",
      "name": "welcome-message",
      "status": "published",
      "published_at": "2023-10-06T23:47:56.678Z",
      "created_at": "2023-10-06T23:47:56.678Z",
      "updated_at": "2023-10-06T23:47:56.678Z",
      "alias": "welcome-message"
    }
  ],
  "has_more": false
}
I