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 are currently in private beta and only available to a limited number of users. APIs might change before GA.To use the methods on this page, you must upgrade your Resend SDK:
npm install resend@6.3.0-canary.0
Get in touch if you’re interested in testing this feature.

Query Parameters

limit
number
Number of templates to retrieve.
  • Default value: 20
  • Maximum value: 100
  • Minimum value: 1
after
string
The ID after which we'll retrieve more templates (for pagination). This ID will not be included in the returned list. Cannot be used with thebefore parameter.
before
string
The ID before which we'll retrieve more templates (for pagination). This ID will not be included in the returned list. Cannot be used with the after parameter.
You can only use either after or before parameter, not both. See our pagination guide for more information.
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