# List templates

`GET /v1/templates`

Requires an API key with the `templates:read` scope. [About keys and scopes](/docs/api/authentication)

Returns templates in this organization. The list form omits the block tree; retrieve a template individually to get its full content. Results are cursor-paginated: pass `meta.pagination.nextCursor` back as `cursor` until it comes back `null`. The cursor is opaque — do not construct or parse one.

## Query parameters

- `limit` (integer, optional, min > 0, max 100, default `20`)
- `cursor` (string, optional, 1–2048 characters)
- `q` (string, optional, 1–200 characters)

## Returns

Returns `200 OK` with a list of `TemplateListItem` objects in `data`, and the next page's cursor in `meta` (see [pagination](/docs/api/pagination)). Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

- `id` (string, required, uuid)
- `name` (string, required)
- `blockCount` (integer, required, min 0, max 9007199254740991) — Blocks in the design, at every level.
- `publishedVersion` (integer | null, required, min > 0, max 9007199254740991) — The version API sends use; null until published. The template itself is the draft.
- `hasUnpublishedChanges` (boolean, required) — The draft differs from the published version, or was never published.
- `thumbnailUrl` (string | null, required, uri) — A small picture of the design (WebP, 320 × 427), redrawn a few seconds after each save; null until the first is drawn.
- `thumbnailUpdatedAt` (string | null, required, date-time) — When the thumbnail was last drawn.
- `updatedAt` (string, required, date-time)

## Example

```bash
curl https://api.kirora.io/v1/templates \
  -H "Authorization: Bearer $KIRORA_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "id": "018f2a4e-6b1c-7d3e-9f40-37386ae05a6b",
      "name": "Weekend specials",
      "blockCount": 0,
      "publishedVersion": 1,
      "hasUnpublishedChanges": true,
      "thumbnailUrl": "https://example.com",
      "thumbnailUpdatedAt": "2030-03-14T09:30:00Z",
      "updatedAt": "2030-03-14T09:30:00Z"
    }
  ],
  "meta": {
    "pagination": {
      "limit": 1,
      "nextCursor": "nextCursor_example"
    }
  }
}
```
