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
The number of templates to return. Defaults to 20
. Maximum is 100
.
The ID of the template to start after. The API will return the templates after
(and not including) the given ID.
The ID of the template to start before. The API will return the templates
before (and not including) the given ID.
Node.js
Rust
PHP
Java
Python
Ruby
Go
.NET
cURL
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
}