Skip to content

Render a template's preview image

GET
/t/{id}/preview.png
curl --request GET \
--url 'https://api.pixonaut.app/t/example/preview.png?fit=cover&compact=1' \
--header 'Authorization: Bearer <token>'

Operation ID: templates.preview.get

The published template drawn with its own default values and clipped to its die-cut shape, as a PNG a storefront shows as a thumbnail. id is baseId@version. Every answer carries an ETag, and a matching if-none-match answers 304. An image read with a key is served no-cache: its URL names no workspace, and a text naming dynamic values, such as {date.year}, draws anew as days pass. A studio thumbnail of a published version never changes and is served immutable. size caps the long edge in pixels; bleed=1 draws the unclipped full-bleed reference instead; its extent is the tenant’s default bleed, which can change, so it is served no-cache and revalidated with its ETag. A key reads published versions only: any other id is 404. showcase draws one of the template’s showcases in place of its defaults, cached and revalidated as the defaults are; an id the template holds no showcase under is 404 showcase_not_found. The image carries no “Powered by Pixonaut” mark on any plan: a shop shows it as its own product image.

id
required

A template id, baseId@version.

string

A template id, baseId@version.

size

The long edge in pixels, clamped to the sizes the api renders.

string

The long edge in pixels, clamped to the sizes the api renders.

width

The width in pixels the image is drawn at, for a caller that does not know its ratio: the long edge is derived from the template’s declared ratio, and clamped as size is. Taken over size when both are given.

string
/^\d+$/

The width in pixels the image is drawn at, for a caller that does not know its ratio: the long edge is derived from the template’s declared ratio, and clamped as size is. Taken over size when both are given.

fit

cover when the image is cropped to fill its box: width is then its short edge.

string
Allowed values: cover

cover when the image is cropped to fill its box: width is then its short edge.

bleed

1 for the unclipped full-bleed reference.

string

1 for the unclipped full-bleed reference.

compact

1 for as few bytes as show the same picture: a JPEG when nothing in it is transparent and that is smaller, else the PNG. The answer’s content-type says which. Ignored with bleed=1.

string
Allowed values: 1

1 for as few bytes as show the same picture: a JPEG when nothing in it is transparent and that is smaller, else the PNG. The answer’s content-type says which. Ignored with bleed=1.

showcase

The id of one of the template’s showcases, as its read lists them: the image is drawn with that set’s values in place of the defaults.

string
/^[A-Za-z0-9_-]{1,40}$/

The id of one of the template’s showcases, as its read lists them: the image is drawn with that set’s values in place of the defaults.

The preview image

string
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

The caller’s copy, named by its ETag, is current

X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: origin_forbidden, feature_disabled, forbidden, workspace_suspended

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

No published template has this id, or showcase_not_found: the template holds no showcase with the id showcase names

object
error
required
string

Examples

Exampleshowcase_not_found

showcase_not_found

{
"error": "showcase_not_found"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: draft_invalid, template_defaults_invalid, draft_has_no_artwork, asset_map_too_large, invalid_query

Media typeapplication/json
object
bytes

Always sent with asset_map_too_large.

number
error
required
string
maxBytes

Always sent with asset_map_too_large.

number
reason

Always sent with draft_invalid.

string

Examples

asset_map_too_large

{
"bytes": 0,
"error": "asset_map_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: rate_limited

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

The caller left before the render started

Media typeapplication/json
object
error
required
string

Examples

Exampleclient_closed_request

client_closed_request

{
"error": "client_closed_request"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: template_defaults_invalid, db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: print_box_unavailable, assets_unavailable, preview_unavailable

Media typeapplication/json
object
error
required
string

Examples

assets_unavailable

{
"error": "assets_unavailable"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors