Skip to content

Product Images — Upload

Uploads a new image for the given product.

REST only — GraphQL upload not supported

Binary file parts are not transportable over JSON GraphQL. The GraphQL createAdminCatalogProductImage mutation exists as a placeholder only and will not accept a file. Use this REST endpoint for image upload.

Endpoint

EndpointMethod
/api/admin/catalog/products/{productId}/imagesPOST

Content type

multipart/form-data — required.

Form fields

FieldTypeRequiredNotes
imagefileyesOne of bmp, jpeg, jpg, png, webp.
positionintegernoSort position; appended to the end if omitted.

Response

201 Created

FieldTypeNotes
idintegerNew product_images.id.
productIdintegerParent product ID (echoed).
pathstringStorage-relative file path.
positionintegerSort position.
urlstringPublic URL.

Errors

HTTPCause
401 UnauthorizedMissing or invalid admin Bearer token.
403 ForbiddenAdmin role lacks catalog.products.edit.
404 Not FoundProduct not found.
422 Unprocessable EntityMissing file, invalid mime, or oversized payload.

Released under the MIT License.