Import templates
Takes a list of template documents — what GET /api/v1/templates/{id} returns, one per template — and creates each as a new template at version 1: history and slug are not carried over (the slug is made from the name, with a numeric suffix when it is taken). The list rows of GET /api/v1/templates carry no html, so they are not an export.
Each entry is checked like a create; one that fails is reported in errors and the rest still land, so a 201 can carry refusals — read errors. The whole import is refused (422 resource_limit_exceeded) if it would take the account past 200 templates.
Request
- Base URL: https://api.imagestep.dev
- URL: https://api.imagestep.dev/api/v1/templates/import
- Auth: API key in header Authorization
Headers
Optional. A client-generated unique key (typically a UUID). Same key + the same request (method, path, query string and body) replays the first response verbatim with Idempotency-Replayed: true, without executing again. Same key + a different one returns 409 idempotency_key_reuse. A repeat that arrives while the first is still running returns 409 request_in_progress, which is retryable. Keys are retained 24 hours. At most 255 characters; a longer one is a 400 invalid_param with param: "Idempotency-Key".
Request body
Example request
[
{
"name": "Quote card",
"width": 1080,
"height": 1350,
"html": "<main><blockquote>{{ quote }}</blockquote><cite>{{ author }}</cite></main>",
"css": "main{display:grid;place-items:center;height:100%;font-family:system-ui}",
"variables": [
"quote",
"author"
]
}
]Response
What landed, and one line per entry that did not
Changes
No recorded changes to this operation across all 1 revision of this API.