API reference · Images
Upload an image
POST/v1/assetsFreeSafe to retry with Idempotency-KeyStores an image for a pass, resized for every screen. Put its reference in the pass's image field.
Query
typeone of: icon, logo, strip, background, thumbnail, wideLogo, googleHerorequiredWhich image it is: it sets the size. logo goes in logoURL, strip in stripURL, and so on.
Body
The image's bytes, PNG or JPEG, up to 2 MB, with its Content-Type. Or JSON, { "url": "https://…" }, and we fetch it. It's resized to its type's shape, so crop it to that first: icon 87 × 87, logo 660 × 660, strip 1125 × 369, background 1074 × 1344, thumbnail 270 × 270, wideLogo 1280 × 400, googleHero 1032 × 812 pixels.
Answer
201Stored
width and height are its size in points; it's stored at 1, 2 and 3 times that.
Errors
Every error has the same shape: see Errors.
| Status | Code | When |
|---|---|---|
| 400 | validation_error | type isn't one of these. |
| 400 | invalid_asset | No image, or the URL isn't HTTPS, isn't public or redirects too often. |
| 409 | idempotency_conflict | The Idempotency-Key was already used for a different request. |
| 413 | asset_too_large | Over 2 MB. |
| 422 | invalid_asset | It isn't an image we can read. |
- Then:
"logoURL": "asset:asset_k3m9q2w7x4n8p1r6"in the pass or template. - An image no pass or template uses is deleted after 36 hours, so use it soon after uploading it. One that's in use stays while it is.