# Mint editor URL

`GET https://postcraft.io/api/v1/templates/{id}/presigned-url`

Returns a short-lived URL the editor SPA opens to edit (or view) the template. Requires an API key: presigned tokens cannot mint, by design.

## 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 |
| ---- | -- | ---- | -------- | ----------- |
| `id` | path | string | yes |  |
| `readonly` | query | `"true"`, `"false"` | no |  |

## Responses

### 200

Presigned URL minted.

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `url` | string | yes |  |

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