---
title: "Product Material Change"
method: POST
path: "/v2/tool/material-swap"
tags: ["edit-workflow"]
---

# Product Material Change

`POST /v2/tool/material-swap`

Re-renders the masked regions of the product photo in the materials
shown by the reference images — matching each one's color, texture,
pattern scale, and orientation — while preserving the product's
silhouette, construction, seams, and shading, and keeping every region
outside the masks unchanged.

The request is processed asynchronously. Poll
`GET /v1/generations/{generation_id}` with the returned `generation_id`
until the generation is completed or failed.

Supply the product photo as either an `AssetIdentifier` reference
(`image_asset_identifier`) or the raw image bytes directly (`image`,
multipart requests only). Provide exactly one of the two forms;
supplying both, or neither, is rejected with a 400.

Supply the masks marking the regions to re-material as either
`AssetIdentifier` references (`mask_asset_identifiers`) or the raw mask
bytes directly (`masks`, multipart requests only) — up to 4 regions; a
single-region edit is a one-item list. Provide exactly one of the two
forms. Every mask must have the same pixel dimensions as the product
photo. White pixels mark the region to change; black pixels are
preserved. Alpha-only masks are also supported: opaque pixels mark the
region to change and transparent pixels are preserved.

Supply the material references as either `AssetIdentifier` references
(`material_asset_identifiers`) or the raw image bytes directly
(`materials`, multipart requests only). Provide exactly one of the two
forms. Send either one material, which every mask takes, or exactly one
material per mask, paired by position.

## Request body

- MaterialSwapRequest — Supply the product photo, the masks, and the material references each as either `AssetIdentifier` references or (multipart requests only) raw image bytes; provide exactly one form per input. Supplying both forms of an input, or neither, is rejected with a 400. Supply up to 4 masks, with either one material for all of them or one material per mask paired by position. A single-region edit is a one-item `masks` (or `mask_asset_identifiers`) list with a one-item material list.
  - `image_asset_identifier` AssetIdentifier — An identifier for an ideogram asset.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `image` string, binary — The product photo to edit (max size 25MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Multipart requests only. Provide exactly one of `image_asset_identifier` or `image`.
  - `mask_asset_identifiers` AssetIdentifier[] — The masks marking the regions of the product photo to change, by reference (max 4). Every mask must have the same pixel dimensions as the product photo. White pixels mark the region to change; black pixels are preserved. Alpha-only masks are also supported: opaque pixels mark the region to change and transparent pixels are preserved. Provide exactly one of `mask_asset_identifiers` or `masks`.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `masks` string[] — The masks marking the regions of the product photo to change (max 4, max size 25MB each), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Every mask must have the same pixel dimensions as the product photo, and follows the same pixel rules as `mask_asset_identifiers`. Multipart requests only. Provide exactly one of `mask_asset_identifiers` or `masks`.
  - `material_asset_identifiers` AssetIdentifier[] — The material reference images, by reference. Only their material — color, texture, pattern scale, and orientation — is applied to the masked regions. Send one material, which every mask takes, or exactly one per mask paired by position. Provide exactly one of `material_asset_identifiers` or `materials`.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `materials` string[] — The material reference images (max size 25MB each), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Only their material — color, texture, pattern scale, and orientation — is applied to the masked regions. Send one material, which every mask takes, or exactly one per mask paired by position. Multipart requests only. Provide exactly one of `material_asset_identifiers` or `materials`.
  - `aspect_ratio` string — The aspect ratio of the generated image. Defaults to the aspect ratio of the product photo when omitted, which preserves the original framing exactly. When a different ratio is requested, the scene is extended to fill the new shape rather than cropped, so part of the frame is newly generated. Supported values are `1:1`, `3:4`, `4:3`, `16:9`, and `9:16`.
  - `quality` 'LOW' | 'MEDIUM' | 'HIGH' — The quality tier for the image edit. Higher tiers may improve detail and take longer to complete.
  - `private` boolean — When true or omitted, the output is kept private to your account. Set to false to publish the output to the public feed. Enterprise accounts always generate privately.
  - `webhook_url` string, uri — HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a JSON POST to this URL once all images for the request have finished generating. The body mirrors the synchronous generate response: `request_id`, `created`, and a `data` array containing every generated image (`url`, `prompt`, `resolution`, `seed`, `is_image_safe`). Each delivery is signed with Ed25519 and verifiable against the public keys at `https://api.ideogram.ai/v1/.well-known/jwks.json`. Must be HTTPS; private and loopback hosts and the cloud metadata service are rejected.

## Response `200`

Material swap accepted for asynchronous processing.

- MaterialSwapResponse — Acknowledgement that the material swap was accepted. Poll `GET /v1/generations/{generation_id}` for status and results.
  - `generation_id` string, required — URL-safe base64 ID accepted by the generation polling endpoint.

## Other responses

- `400` — Invalid input provided.
- `401` — Unauthorized.
- `402` — Insufficient credits or quota.
- `403` — Not authorized to create a material swap.
- `429` — Too many requests.

## Changes

- **2026-08-31** `583d86789548` — 8 warning, 8 info
  - removed the request property `mask` (media type: multipart/form-data)
  - removed the request property `mask` (media type: application/json)
  - removed the request property `mask_asset_identifier` (media type: multipart/form-data)
  - removed the request property `mask_asset_identifier` (media type: application/json)
  - …12 more
- **2026-08-26** `204996bf317a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/ideogram/apis/ideogram-openapi-3-0/changes/v2/tool/material-swap/post.md)

---

[API](https://skmtc.dev/ideogram/apis/ideogram-openapi-3-0.md) · [All operations](https://skmtc.dev/ideogram/apis/ideogram-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ideogram/ideogram-openapi-3-0/revisions/583d86789548/schema)
