curl --request POST \
--url https://api.cope.com/v1/commerce/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"blob": {
"byte_size": 184320,
"checksum": "FjvIv22QWqc6IUNr/yWgkw==",
"content_type": "image/png",
"filename": "quiet-launch-cover.png"
}
}
'
{
"data": {
"direct_upload": {
"headers": {
"Content-Type": "<string>"
},
"url": "<string>"
},
"upload_token": "<string>"
}
}
Create a media upload session
Step one of three. Returns an upload token and a direct upload URL; send the file bytes to that URL with the returned headers, then attach the token to a product. The URL points at object storage, not at this API. A token is consumed by a successful attach and cannot be reused; a rejected attach leaves it usable.
POST
/
v1
/
commerce
/
uploads
curl --request POST \
--url https://api.cope.com/v1/commerce/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"blob": {
"byte_size": 184320,
"checksum": "FjvIv22QWqc6IUNr/yWgkw==",
"content_type": "image/png",
"filename": "quiet-launch-cover.png"
}
}
'
{
"data": {
"direct_upload": {
"headers": {
"Content-Type": "<string>"
},
"url": "<string>"
},
"upload_token": "<string>"
}
}
Authorizations
Bearer credential for the public API. Vendor integrations should send a live COPE API key (ck_live_*; keys issued earlier as cope_sk_live_* keep working). Clerk bearer tokens are also accepted when paired with X-Cope-Business-Id.
Body
application/json
Show child attributes
Show child attributes
Response
Successful response
Show child attributes
Show child attributes