# Get template version

`GET https://postcraft.io/api/v1/templates/{id}/version`

Cheap change probe: the template's timestamps without its content. Poll it to learn whether a template changed since you last looked, or compare `publishedAt` against a stored value to tell whether what renders has changed.

## Authentication

Send one of these headers:

- `x-api-key: <key>`: Long-lived account credential. Create one from the dashboard.
- `Authorization: Bearer <token>`: Short-lived presigned token scoped to a single template (minted via /presigned-url).

## Parameters

| Name | In | Type | Required | Description |
| ---- | -- | ---- | -------- | ----------- |
| `id` | path | string | yes |  |

## Responses

### 200

The template's current timestamps.

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `updatedAt` | string | yes | When the template row last changed, draft saves included. |
| `draftUpdatedAt` | string or null | yes | When the draft last changed, or null when there are no unpublished changes. |
| `publishedAt` | string | yes | When the published copy last changed: when what renders last changed. |
| `agentActiveAt` | string | no | When an agent last edited the template through MCP. Absent when no agent has, and withheld from read-only editor sessions. |

### 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
