Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error, cursor } = await rewrite.templates.list({
limit: 20,
withi18n: true,
});
if (error) throw error;{
"ok": true,
"data": [
{
"id": "748395130237498620",
"name": "login_code",
"content": "Rewrite: seu codigo e {{code}}",
"i18n": {
"br": "Rewrite: seu codigo e {{code}}"
},
"variables": [
{
"name": "code",
"fallback": "478201"
}
],
"tags": {
"flow": "otp",
"channel": "login"
},
"description": "Template usado no fluxo de login",
"createdAt": "2026-03-20T14:22:31.562Z"
}
],
"cursor": {
"persist": false
}
}Templates
List templates
List reusable templates available to the current project. Results are paginated with a top-level cursor.
GET
/
templates
Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error, cursor } = await rewrite.templates.list({
limit: 20,
withi18n: true,
});
if (error) throw error;{
"ok": true,
"data": [
{
"id": "748395130237498620",
"name": "login_code",
"content": "Rewrite: seu codigo e {{code}}",
"i18n": {
"br": "Rewrite: seu codigo e {{code}}"
},
"variables": [
{
"name": "code",
"fallback": "478201"
}
],
"tags": {
"flow": "otp",
"channel": "login"
},
"description": "Template usado no fluxo de login",
"createdAt": "2026-03-20T14:22:31.562Z"
}
],
"cursor": {
"persist": false
}
}Authorizations
Send your API key as Authorization: Bearer rw_....
Required scope: project:templates:read.
Query Parameters
Cursor for forward pagination. Send exactly one of after or before when paginating.
Example:
"748395130237498412"
Cursor for backward pagination. Send exactly one of after or before when paginating.
Example:
"748395130237498412"
Page size. Backend cursor schemas validate this between 2 and the route-specific maximum.
Required range:
2 <= x <= 100When true, include the template i18n map in list/detail responses.