Skip to content

List templates

Every template on your team, newest first.

http
GET /v1/templates

Requires a Full access API key.

Query parameters

Cursor-paginated:

ParameterTypeDescription
limitnumberHow many to return. Default 20, min 1, max 100.
afterstringReturn templates after this id. Cannot be combined with before.
beforestringReturn templates before this id. Cannot be combined with after.

Example

bash
curl "https://api.sendgrail.com/v1/templates" \
  -H "Authorization: Bearer $SENDGRAIL_API_KEY"
js
const res = await fetch('https://api.sendgrail.com/v1/templates', {
  headers: { Authorization: `Bearer ${process.env.SENDGRAIL_API_KEY}` },
});

const { data, has_more } = await res.json();

Response

The rows are lean — name, alias, status and timestamps, but no bodies, defaults or variables. Fetch one with Get a template for the full object.

json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "template",
      "id": "d3f8c2a1-6b47-4e9a-b25c-1f0e7a9d4c83",
      "alias": "welcome-email",
      "name": "Welcome email",
      "status": "published",
      "published_at": "2026-07-15T10:12:04+00:00",
      "created_at": "2026-07-15T09:58:41+00:00",
      "updated_at": "2026-07-15T10:12:04+00:00"
    }
  ]
}

has_more tells you whether another page exists — there is no total, because a keyset paginator never counts the table. To walk every page, pass the last id you saw as after until has_more is false. See Pagination.

Transactional email on your own domain.