Upload an input image
const url = 'https://example.com/v1/uploads';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/uploads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@fileStore an input image; returns {upload_key, image_url, asset_id}.
Free (0 credits) — capability + rate-limit gated only. The upload_key
is what workflow dispatch accepts as product_image_s3_key /
source_image_s3_key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The input image (jpeg/png/webp, ≤25 MB).
Responses
Section titled “Responses”Successful Response
POST /v1/uploads response — durable handles plus a preview URL.
upload_key remains the additive handle for CTM’s explicit
product_image_s3_key / source_image_s3_key fields. asset_id is the
canonical identity accepted by POST /v1/try-on. image_url is a
presigned preview URL and is NOT accepted back as an input.
object
Durable upload handle — pass into workflow dispatch.
Short-lived presigned preview URL (not an input handle).
Durable canonical asset ULID for /v1/try-on references.
Examplegenerated
{ "upload_key": "example", "image_url": "example", "asset_id": "example"}Validation Error
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}