Skip to main content
POST
Attach an asset to a product

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: ^[!-~]+$

Path Parameters

product_id
integer
required

Body

application/json
asset_id
string<uuid>
required
position
integer | null

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

Required range: 0 <= x <= 1000000
is_main
boolean
default:false

Also make this asset the product's main image.

Response

OK

product_id
integer
required
main_image
string | null
required
assets
GalleryEntryOut · object[]
required