Skip to main content
POST
Upload a file

Authorizations

Authorization
string
header
required

Use a project API key from Settings > API Access. Send it as Authorization: Bearer wpk_.... See authentication and scopes for setup and permissions.

Headers

Idempotency-Key
string

Reuse this key for retries of the same write. Scoped to this API key; retained for 30 days, after which the key may be reused. Different requests with the same key return 409.

Required string length: 1 - 128
Pattern: ^[!-~]+$

Body

multipart/form-data
file
file
required

The image or PDF (multipart/form-data).

product_id
integer | null

Attach the file to this product.

sku
string | null

The product's SKU, instead of product_id.

position
integer | null

Sort key within the product's images. Appended when omitted.

is_main
boolean
default:false

Also make the file the product's main image.

alt_text
string | null

Alt text for every language (at most 500 characters).

Response

OK

id
string
required
filename
string
required
mime_type
string
required
file_size
integer
required
width
integer | null
required
height
integer | null
required
url
string
required

Durable path of the file, relative to the WisePIM app origin. A product's main_image carries this value for its main asset.

thumbnail_url
string | null
required
alt_text
required

One text for every language, or a map of locale to text.

source_url
string | null
required

The URL the asset was imported from, when it was.

products
AssetProductOut · object[]
required

The products showing the asset, at most 100, by position. When the request names a product (the product_id filter, or an upload that attached the file), that product's entry is always listed, first.

products_truncated
boolean
required

Whether the asset may be attached to more products than products lists. The named product's entry is never the one left out, so GET /assets?product_id= gives every image of that product with its position and is_main.

created_at
string<date-time>
required
updated_at
string<date-time>
required