Crop and Re-embed a Catalog Image
POST/v1/api/quality/catalog/product-embeddings/:productId/:embeddingId/crop
Cuts one or more rectangular regions out of a catalog image and embeds each as its own reference image, for old full-frame captures that hold several products. The original image is then permanently deleted: its embedding rows (rotation, color and SIFT siblings), its media record and its stored file.
The crops are created as active. Cropping a pending image therefore approves it
("Crop & Approve"); cropping an active image keeps it approved. If the original was
the product's thumbnail override, the override moves to the first crop.
Only images backed by a media record can be cropped; legacy base64 capture crops are rejected with 404. Cropping and embedding (every rotation of every crop) run before anything is written, and the original is only deleted once all crops are stored, so a failure leaves the original untouched. If another request already replaced or moved the image, or it was rejected or deleted, nothing is changed and the request fails with 409.
Auth Required
Required Permissions:
quality.catalog:write
The signed-in user must also belong to the product's site, which is looked up from the
product itself (the request carries no site_id). API keys are not site-scoped and are
checked on their permission alone.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 500
Crops created and the original deleted
Bad Request. The request was invalid or cannot be otherwise served.
Unauthorized. User is not authenticated or session is invalid.
The signed-in user does not belong to the product's site
Embedding not found, not in the pool, or has no stored image to crop
The image was cropped, rejected, deleted or moved by another request, or the active embedding model changed, meanwhile
Internal Server Error