upload_product_image
Attach an image to an existing product using base64 data or a public URL. Returns the created image record for later management.
Instructions
Attach an image to an existing product. Provide exactly one of
image_base64 (with content_type) or image_url.
Use this after create_product returns a product ID. For replacing
a previously-uploaded image, delete the old one with
delete_product_image first. Marked destructive because subsequent
edits to the image set are visible publicly.
Args:
api_key: Partle API key (prefix pk_).
product_id: ID of the product to attach the image to.
image_base64: Raw image data, base64-encoded. When set,
content_type is required (e.g. image/jpeg).
content_type: MIME type of the base64 payload. Required with
image_base64. One of: image/jpeg, image/png,
image/gif, image/webp.
image_url: URL the server should fetch the image from. Use this
when the image is already hosted somewhere public — saves
base64 overhead.
Returns:
The created ProductImage record with its id (use for deletion)
and storage path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | Yes | ||
| product_id | Yes | ||
| image_base64 | No | ||
| content_type | No | ||
| image_url | No |