---
search:
  tags:
    - Product Images
    - POST
seo:
  description: >-
    Uploads a new image to a product. The image data must be Base64-encoded…
    Reference for the POST /products/{product_id}/assets endpoint in the Bolder
    API v1.
sidebar:
  label: Upload product image
  badge: POST
title: Upload product image
type: openapi-operation
---
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`

**Request body** (`application/json`, required)

- `data` (string, required) — Base64-encoded image data URI (\`data:image/jpeg;base64,...\`)
- `file_name` (string, required)
- `title` (string)
- `description` (string)

Request body example:

```json
{
  "data": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
  "file_name": "photo.jpg",
  "title": "Front view"
}
```

**Responses**

- `201` — Image uploaded
- `422` — Validation errors

Response example, 201:

```json
{
  "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
    }
  }
}
```

Response example, 422:

```json
{
  "_class": [
    "errors"
  ],
  "_embedded": {
    "errors": [
      {
        "_class": [
          "error"
        ],
        "field": "product.title",
        "messages": [
          "can't be blank"
        ]
      }
    ]
  }
}
```
