Skip to main content
POST

Upload a product image

Scope:inventory:products.write
https://api.holded.com/api/v2/products/{productId}/images

Uploads an image and associates it with the specified product. Send the file as `multipart/form-data` using the `file` field. Allowed image types: jpeg, png, gif. Maximum 200 images per product.

Parameters

Path parameters

productIdstringrequired

Product ID (24-char hex ObjectId)

Request body

object
filestring<binary>required

Image file (jpeg, png, gif)

Request

python
import requests

url = "https://api.holded.com/api/v2/products/{productId}/images"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
}

files = {"file": open("file.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())

Responses

Response

json
{
  "id": "507f1f77bcf86cd799439011"
}

Success responses

201Image uploadedapplication/json
object
idstringrequired

Error responses

400Bad requestapplication/json
401Invalid or missing API keyapplication/json
403Insufficient permissionsapplication/json
404Product not foundapplication/json
422Validation errorapplication/json
429Rate limit exceededapplication/json