Skip to main content

Assets

📄️List assets (keyset-paginated)

Returns one page of usable assets (each with a durable stored url) in the uniform list envelope `{ data, pagination }`. Keep paginating while `pagination.nextCursor` is non-null — even when `data` is empty — passing it back verbatim as `?cursor=`. Filter by `?type=`, `?status=` and/or `?favorited=true` (combinable); an omitted `?status=` returns the ready set (`active` + `completed`), and `?favorited=true` returns only shortlisted assets. Add `?showDeleted=true` to include deleted assets (every row then carries `deletedAt`). Search-grounded images are never listed: they may only be shown inside Mocart.

📄️Upload an image as an asset

Stores one image (PNG, JPEG or WebP, at most 20 MB) as a new asset of the key's account. Send `multipart/form-data` with the image in the `file` part, plus exactly one of `productId` or `brandId` (a file with no product) and an optional `name`. The `201` is a small `AssetUpload` body, not the asset read shape: a brand-level file is not visible to `GET /assets`. The type is read from the file itself, not from the declared content type. `Idempotency-Key` is required: a retry with the same key and the same file returns the same asset and stores nothing new. The returned `assetId` can be attached to a chat turn.