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
| Type | Input field | Use case |
|---|---|---|
URL | urlFile | Image hosted at a public URL (CDN, DAM system) |
BASE64 | base64File | Binary image data encoded as base64 |
FILE | file | Standard file upload (multipart form) |
Attaching to other entities
Replace productId with the appropriate field to attach media to other entities:
| Field | Entity |
|---|---|
productId | Product |
clusterId | Cluster |
categoryId | Category |
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
- Add product video — attach a video to a product
- Get product images with responsive transformations — fetch and resize images on the storefront