> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drin.run/llms.txt
> Use this file to discover all available pages before exploring further.

# List templates

> GET /v1/templates — list the saved templates in a project, cursor-paginated.

Return the saved templates in a project, newest first. Cursor-paginated like every list endpoint.

**`GET /v1/templates`**

Results are scoped to the project resolved from your key (or the `X-Drin-Product` header for account-wide keys).

## Query parameters

<ParamField query="limit" type="integer">
  Page size, `1`–`100`. Defaults server-side.
</ParamField>

<ParamField query="cursor" type="string">
  The `nextCursor` from a previous response. Omit for the first page; when `nextCursor` is `null` you've reached the end. See [Pagination](/api-reference/pagination).
</ParamField>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.drin.run/v1/templates?limit=20" \
    -H "Authorization: Bearer $DRIN_API_KEY"
  ```

  ```typescript Node.js theme={null}
  import { DrinClient } from "@drin00/sdk";

  const drin = new DrinClient({ apiKey: process.env.DRIN_API_KEY });

  const { data, nextCursor } = await drin.templates.list({ limit: 20 });

  // Or walk every page with the async iterator:
  for await (const template of drin.templates.paginate()) {
    console.log(template.slug, template.name);
  }
  ```
</CodeGroup>

## Response

A cursor page of [template](/api-reference/templates/get) objects.

```json 200 OK theme={null}
{
  "data": [
    {
      "id": "tmpl_8XQ2k9",
      "slug": "order-receipt",
      "name": "Order Receipt",
      "subject": "Receipt {{orderId}}",
      "html": "<p>Hi {{firstName}}, thanks for your order.</p>",
      "text": null,
      "variables": ["firstName", "orderId"],
      "createdAt": "2026-06-02T10:00:00.000Z",
      "updatedAt": "2026-06-02T10:00:00.000Z"
    }
  ],
  "nextCursor": null
}
```
