Skip to main content

Upload product images

Attach images to a product, cluster or category using the GraphQL API. Supports uploading from a URL or base64-encoded data.

Mutation

mutation CreateMediaImage($input: MediaImageInput!) {
mediaImageCreate(input: $input) {
id
productId
alt { language value }
description { language value }
priority
createdAt
}
}

Variables

{
"input": {
"productId": "26",
"alt": [
{ "language": "EN", "value": "Industriële Kachel HT-350 front view" },
{ "language": "NL", "value": "Industriële Kachel HT-350 vooraanzicht" }
],
"description": [
{ "language": "EN", "value": "Product photo showing the front of the HT-350 industrial heater" },
{ "language": "NL", "value": "Productfoto met de voorkant van de HT-350 industriële kachel" }
],
"tags": [
{ "language": "NL", "values": ["voorkant", "hoofdfoto"] }
],
"priority": 1,
"uploadImages": [
{
"uploadType": "URL",
"urlFile": {
"url": "https://example.com/images/ht-350-front.jpg",
"fileName": "ht-350-front.jpg"
}
}
]
}
}

Response

{
"data": {
"mediaImageCreate": {
"id": "66d6ab6e590599fecc3fa5a2",
"productId": "26",
"alt": [{ "language": "NL", "value": "Industriële Kachel HT-350 vooraanzicht" }],
"description": [{ "language": "NL", "value": "Productfoto met de voorkant van de HT-350 industriële kachel" }],
"priority": 1,
"createdAt": "2026-03-05T10:00:00.000Z"
}
}
}

Upload from base64

For images stored as binary data in a PIM or DAM, use the BASE64 upload type:

{
"input": {
"productId": "26",
"alt": [{ "language": "NL", "value": "Zijaanzicht" }],
"description": [{ "language": "NL", "value": "Zijaanzicht productfoto" }],
"tags": [{ "language": "NL", "values": ["zijkant"] }],
"priority": 2,
"uploadImages": [
{
"uploadType": "BASE64",
"base64File": {
"base64": "iVBORw0KGgo...",
"fileName": "ht-350-side.png"
}
}
]
}
}

Upload types

TypeInput fieldUse case
URLurlFileImage hosted at a public URL (CDN, DAM system)
BASE64base64FileBinary image data encoded as base64
FILEfileStandard file upload (multipart form)

Attaching to other entities

Replace productId with the appropriate field to attach media to other entities:

FieldEntity
productIdProduct
clusterIdCluster
categoryIdCategory

How it works

The priority field controls display order (lower numbers appear first). Use alt for accessibility text and description for longer captions. Both alt and description are localized. The tags field accepts arrays of values per language, useful for filtering or grouping images (e.g. "lifestyle", "technical", "packaging"). You can upload multiple images in a single call by adding more entries to the uploadImages array.

See also