# List templates

`GET https://postcraft.io/api/v1/templates`

Lists the templates in this API key's workspace, newest change first. Soft-deleted templates are omitted. Paginate by passing the previous response's `nextCursor` as `cursor`; a null `nextCursor` means the last page. Requires an API key: a presigned token is scoped to one template and has nothing to list.

## Authentication

Send one of these headers:

- `x-api-key: <key>`: Long-lived account credential. Create one from the dashboard.

## Parameters

| Name | In | Type | Required | Description |
| ---- | -- | ---- | -------- | ----------- |
| `cursor` | query | string | no | Opaque cursor from a previous response's `nextCursor`. |
| `limit` | query | integer | no |  |

## Responses

### 200

A page of templates.

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `templates` | object[] | yes |  |
| `nextCursor` | string or null | yes | Pass as `cursor` to fetch the next page. Null on the last page. |

### Errors

Every error answers with `{ "error": { "code": string, "message": string } }`.

| Status | Meaning |
| ------ | ------- |
| 400 | Invalid input. |
| 401 | Missing or invalid credential. |
| 403 | Authenticated but not allowed. |
| 404 | Not found. |
| 413 | Payload exceeds size limit. |
| 422 | Template render failed. |
| 429 | Rate limited. |

The whole API as an OpenAPI document: https://postcraft.io/api/v1/openapi.json
