---
title: "Remove a masked object from an image, by asset id or by uploaded bytes"
method: POST
path: "/v2/object-removal"
tags: ["object-removal"]
---

# Remove a masked object from an image, by asset id or by uploaded bytes

`POST /v2/object-removal`

Remove a masked object from an image. For each of the source image and the
mask, supply either an `AssetIdentifier` reference (`image_asset_identifier`
/ `mask_asset_identifier`) or the raw image bytes directly (`image` / `mask`,
multipart requests only) — callers are never required to call
`POST /v2/assets` first. If both a reference and bytes are supplied for the
same input, the reference wins and the bytes are ignored.

Poll for completion with `GET /v1/generations/{generation_id}` using the
returned `generation_id`.

This is the `/v2` capability-first shape; no `model` or `model_uri` field is
exposed until a second backend exists.

## Request body

- RemoveObjectFromV2AssetsRequest — Supply the source image and the mask each as either an `AssetIdentifier` reference or (multipart requests only) raw image bytes. At least one of `image_asset_identifier` / `image` is required, and likewise at least one of `mask_asset_identifier` / `mask`; if both a reference and bytes are given for the same input, the reference is used and the bytes are ignored.
  - `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 source image to remove an object from (max size 10MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Multipart requests only; ignored if `image_asset_identifier` is also supplied.
  - `mask_asset_identifier` AssetIdentifier — An identifier for an ideogram asset.
    - `asset_type` 'ASSET' | 'CANVAS_ASSET' | 'LAYERED_ASSET' | 'RESPONSE' | 'UPLOAD', required
    - `asset_id` string, required
  - `mask` string, binary — A binary mask the same size as the image, as raw bytes; white (>= 128) marks the region to remove. Only JPEG, PNG, and WEBP formats are supported. Multipart requests only; ignored if `mask_asset_identifier` is also supplied.
  - `seed` integer — Random seed. Set for reproducible generation.
  - `store_assets` boolean — Whether to store resulting generation assets on Ideogram. Defaults to `false` for API developers; first-party mini-apps should pass `true`. Reserved in the schema for an upcoming storage-control rollout — currently accepted but not yet enforced.

## Response `200`

Object removal request accepted; poll for completion with `GET /v1/generations/{generation_id}`.

- RemoveObjectFromV2AssetsResponse — Acknowledgement returned by `POST /v2/object-removal`. The request is accepted for asynchronous processing; poll for completion and results using `GET /v1/generations/{generation_id}` with the returned `generation_id`.
  - `generation_id` string, required — URL-safe base64 ID of the accepted generation. Accepted by the `GET /v1/generations/{generation_id}` polling endpoint.

## Other responses

- `400` — Invalid input provided.
- `401` — Unauthorized.
- `402` — Insufficient credits or quota.
- `403` — Not authorized to remove an object.
- `429` — Too many requests.

---

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