Skip to navigation

API: Images

What It Does

Gives each product 1 principal picture from your own system, in 2 steps:

  1. Upload web-sized pictures. Each gets an image_id.
  2. Set an uploaded picture as a product’s principal picture.

The principal picture shows on the product in tieback and on its passport.

RouteReturns
POST /v1/imagesAn image_id for each uploaded picture
POST /v1/products/imagesA status for each product

Who It’s For

Developers bringing product photos into tieback from a store or a product information system.

Before You Start

  • Use a key with Import products (see API: Credentials). Send Authorization: Bearer <token>.
  • A key works in its own workspace only. It cannot remove pictures people added or change anything else about a product.
  • Get product ids from API: Products (POST /v1/products/lookup finds them by SKU, GTIN or your own id).
  • Send web-sized pictures. A store’s own image service can give you one: for example, add width=1600 to a Shopify image address.

POST /v1/images

Send multipart/form-data with 1 to 10 files, each in a field named files.

  • Types: PNG, JPEG or WebP. The type is read from the file itself, never from its name.
  • Size: up to 2 MB a file, and up to 2048 pixels on the long side. The whole request is up to 21 MB.
curl -X POST https://api.tieback.io/v1/images \
-H "Authorization: Bearer $TOKEN" \
-F "files=@front.jpg"
{
"images": [
{
"image_id": "3c1e…",
"filename": "front.jpg",
"mime_type": "image/jpeg",
"size_bytes": 182113,
"status": "stored",
"expires_at": "2026-11-14T10:00:00Z"
}
]
}
  • status: stored, or not_stored if that file could not be saved (send it again).
  • filename: the name as kept. Folders, spaces and control characters are removed.
  • expires_at: set the picture on a product before then. An upload that is never set is removed after 24 hours.
  • Refused files: if any file is refused, nothing is uploaded and the reply lists each file with its reason:
    • empty;
    • too_large (over 2 MB);
    • too_many_pixels (over 2048 pixels on the long side);
    • not_png_jpeg_or_webp;
    • unreadable (the picture’s size could not be read).
  • Limit: a workspace can hold up to 500 uploads that are not yet set (409 beyond that).

POST /v1/products/images

Sets uploaded pictures as products’ principal pictures: up to 100 items a call, 1 per product.

curl -X POST https://api.tieback.io/v1/products/images \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "items": [ { "product_id": "9a00…", "image_id": "3c1e…" } ] }'
{
"results": [
{
"index": 0,
"product_id": "9a00…",
"image_id": "3c1e…",
"status": "set",
"attachment_id": "e81f…"
}
]
}
statusMeaning
setThe picture is now the product’s principal picture
already_setThat picture is already the product’s principal picture; nothing changed
kept_tieback_pictureSomeone added a picture to the product in tieback; it stays, and yours is not added
removed_in_tiebackSomeone removed the API’s picture from the product in tieback; the API sets none there again
in_use_by_noticeA draft recall notice uses the API’s current picture; it stays until the notice is done
product_not_foundNo such product in this workspace
image_not_foundNo such upload in this workspace, not stored, or expired before it was set

Replacing a picture: setting a new picture replaces the one the API set before. Pictures people add in tieback always win: when someone adds a picture to a product, the API’s picture on it is retired at once. 1 upload can be set on several products.


Errors

Errors are application/problem+json with title, status, detail and request_id (also in the X-Request-Id header; quote it to support). A request body over 21 MB (uploads) or 64 KB (set) gets 413. 503 means try again shortly; an upload that was stored before the error stays until it expires.