Skip to content
BolderBolder Developers
Esc
↑↓navigate↵open⌘Jpreview

Upload product image

Uploads a new image to a product. The image data must be Base64-encoded and sent in the data field along with the file name and MIME type. Requires admin scope.

POST/products/{product_id}/assets
Authorization
AuthorizationBearer token (JWT) · headerrequired

OAuth 2.0 Bearer token. Obtain via POST https://auth.onbolder.com/oauth/token.

Scopes:admin
Path parameters
product_idstringrequired

Product ID or slug

Request body
requiredapplication/json
datastringrequired

Base64-encoded image data URI (data:image/jpeg;base64,...)

file_namestringrequired
titlestring
descriptionstring
Responses
201

Image uploaded

file_namestring
titlestring
descriptionstring
_linksobject
Show properties
thumbnailHalLink
Show properties
hrefstring
methodstring
titlestring
typestring
templatedboolean
smallHalLink
Show properties
hrefstring
methodstring
titlestring
typestring
templatedboolean
mediumHalLink
Show properties
hrefstring
methodstring
titlestring
typestring
templatedboolean
largeHalLink
Show properties
hrefstring
methodstring
titlestring
typestring
templatedboolean
originalHalLink
Show properties
hrefstring
methodstring
titlestring
typestring
templatedboolean
btc:delete_product_assetHalLink
Show properties
hrefstring
methodstring
titlestring
typestring
templatedboolean
422

Validation errors

_classstring[]
_embeddedobject
Show properties
errorsobject[]
Show properties
Array of object
_classstring[]
fieldstring
messagesstring[]
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.onbolder.com/v1/products/string/assets' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "data": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
  "file_name": "photo.jpg",
  "title": "Front view"
}'
Response
{
  "file_name": "string",
  "title": "string",
  "description": "string",
  "_links": {
    "thumbnail": {
      "href": "string",
      "method": "string",
      "title": "string",
      "type": "string",
      "templated": true
    },
    "small": {
      "href": "string",
      "method": "string",
      "title": "string",
      "type": "string",
      "templated": true
    },
    "medium": {
      "href": "string",
      "method": "string",
      "title": "string",
      "type": "string",
      "templated": true
    },
    "large": {
      "href": "string",
      "method": "string",
      "title": "string",
      "type": "string",
      "templated": true
    },
    "original": {
      "href": "string",
      "method": "string",
      "title": "string",
      "type": "string",
      "templated": true
    },
    "btc:delete_product_asset": {
      "href": "string",
      "method": "string",
      "title": "string",
      "type": "string",
      "templated": true
    }
  }
}

Was this page helpful?