media

Layerize Assets

Changed on

Turn an image into downloadable full-size PNG layers and linked text metadata.

Returns a task immediately; poll its links.self or supply callback_url for a signed terminal webhook. Requires media:generate; polling uses tasks:read. No canvas-write/export scope or rollout flag is required. Billing uses the normal Layerize credit precheck and usage. Some effects may be delivered as composite layers with explicit partial-result warnings. PNG/JPEG/WebP only; EXIF orientation is normalized before reconstruction.

post/media/layerize-assets

Request

  • Base URL
    https://api.moda.app/v1
  • URL
    https://api.moda.app/v1/media/layerize-assets
  • Auth
    HTTP bearer

Headers

Moda-Version'2026-04-12' | '2026-05-01'
Example:2026-05-01

Calendar-dated API version pin. New integrations should pin 2026-05-01 to opt into the newest response shapes. For back-compat the server also accepts requests with no header and resolves them to the current default (today: 2026-04-12); that default advances on each sunset date. Any unsupported value returns 400 unsupported_version.

Request body

imagestring required

Accessible file_ upload reference or HTTP(S) raster image URL.

mode'full' | 'text'

Full reconstruction, or text separation over the remaining artwork.

idempotency_keystring nullable
callback_urlstring nullable

Response

Successful Response

idstring required

Prefixed task_... identifier.

kind'design' | 'export' | 'remix' | 'brand_kit_extract' | 'layerize_assets' required

Discriminator for the kind-specific result payload.

status'queued' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'expired' required

Frozen public status taxonomy. DB enum values are mapped at the API boundary -- never exposed directly.

created_atstring nullable

ISO 8601 timestamp.

started_atstring nullable

ISO 8601 timestamp.

completed_atstring nullable

ISO 8601 timestamp.

attemptinteger required

Current attempt number (1-based).

max_attemptsinteger required

Maximum attempts before dead-lettering.

attempts_startedinteger required

Number of attempts STARTED (claimed by a worker) — never attempts completed. 0 means the task has never been claimed. The claim itself increments the counter, so a task on its first attempt reports 1 while RUNNING and stays at 1 through that attempt's retry backoff. The retry signal is therefore status == "queued" && attempts_started >= 1 (a queued task that has already burned an attempt), NOT >= 2. Unlike attempt, this is the raw counter and is not floored to 1.

first_started_atstring nullable

ISO 8601 timestamp of when the FIRST attempt was claimed. null means unknown — either the task has never started, or it predates this field being recorded. started_at remains the CURRENT attempt's start, so on a retried task the two differ and the gap is the real wall-clock age of the work.

inputobject nullable

Sanitized echo of the original request.

errorobject nullable

Error info: {message, retryable, attempt}. Present for failed tasks, and also for a NON-terminal task that carries an error from an earlier attempt — on a non-terminal task this always describes the PREVIOUS, already-dead attempt, never the one currently in flight. attempt is the attempts_started value the error is tied to (0 when the failure happened before any claim).

retry_after_msinteger nullable

Suggested milliseconds to wait before the next poll. Null for terminal tasks.

Changes