Skip to content

Read what a template's print size is judged by

GET
/v1/templates/{id}/constraints
curl --request GET \
--url https://api.pixonaut.app/v1/templates/example/constraints \
--header 'Authorization: Bearer <token>'

Operation ID: templates.constraints.get

The template’s declared aspect ratio and the tolerance around it, so a consumer can check a size itself before asking POST /v1/templates/{id}/print-size. fit says how the artwork sits inside a legal box. Naming a blankId and placementId (both or neither) adds that placement’s bounds: its largest and default print box, the box a proof or design naming it and no size prints at (printWidthMm × printHeightMm, the template’s ratio fitted into the default box), and the bleed and safe area it prints with. A client draws its live preview against that box and those margins so it frames the design as the proof does. A named placement that does not resolve, or whose stored sizes are unusable, is refused with unknown_placement.

id
required

A template id, baseId@version.

string

A template id, baseId@version.

blankId
string
>= 1 characters
placementId
string
>= 1 characters

The template’s print-size constraints

Media typeapplication/json
object
fit
string
placement
object
blankId
required
string
bleedMm
required
number
cmykPreviewProfile
required

The bundled output profile whose tables draw a design on the placement on screen, or, where cmykPreviewTables is said, draw it when those cannot be read.

string
cmykPreviewTables

Where the tables a design on the placement is drawn through are read, when its print goes through an output profile the workspace uploaded and they are made: a path on the api, read with the same key.

string
coverage
required

full when a print covers the placement’s whole area: the size rule then refuses one smaller than maxWidthMm × maxHeightMm (print_size_not_area). within when it is placed inside it.

string
defaultHeightMm
required
number
defaultWidthMm
required
number
maxHeightMm
required
number
maxWidthMm
required
number
placementId
required
string
printHeightMm
required
number
printWidthMm
required
number
safeAreaMm
required
number
shape

Where on the product a print may go, when not the whole rectangle: the outline, then each cut-out, in fractions of the print box, filled even-odd. A live preview clips the design to it and draws it as a guide, as the proof and the print file are cut to it.

object
cutByPrintShop

True when the print shop cuts the product to this shape: the outline and the cut-outs go into the print file as its cut line. Omitted, the product already has the shape.

boolean
dFrac
required

The shape as SVG path data in fractions of the print area, 0 to 1 across and down (curves, no arcs): its first subpath the outline, every further one a cut-out, filled even-odd, each subpath closed.

string
<= 65536 characters
sizes
required

The blank’s sizes the template can and can’t print at, on a placement whose print area changes with an option (coverage full, or a position that prints one size only). Both empty on a placement whose area doesn’t, which the template fits at every size.

object
fits
required

The sizes the template prints at here, by option value, such as S; several options’ values are joined with /.

Array<string>
misfits
required

The sizes the template can’t print at here: a design at one is refused when committed.

Array<string>
ratio
required
object
h
required

The ratio’s height part. Positive.

number
> 0
w
required

The ratio’s width part. Positive.

number
> 0
ratioTolerance
required
number
templateId
required
string

Examples

Exampleexample

Example

{
"fit": "contain",
"placement": {
"blankId": "blank_tshirt",
"bleedMm": 3,
"cmykPreviewProfile": "ISOcoated_v2_eci",
"coverage": "within",
"defaultHeightMm": 360,
"defaultWidthMm": 300,
"maxHeightMm": 420,
"maxWidthMm": 330,
"placementId": "front",
"printHeightMm": 360,
"printWidthMm": 280,
"safeAreaMm": 5,
"sizes": {
"fits": [],
"misfits": []
}
},
"ratio": {
"h": 360,
"w": 280
},
"ratioTolerance": 0,
"templateId": "tshirt-basic@2"
}
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.

Refused: not_found

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "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: invalid_query, unknown_placement

Media typeapplication/json
object
error
required
string

Examples

invalid_query

{
"error": "invalid_query"
}
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.

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

object
error
required
string

Examples

Exampledb_error

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

Media typeapplication/json
object
error
required
string

Examples

Exampleprint_box_unavailable

print_box_unavailable

{
"error": "print_box_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