Upload Single Image
2/7/25Less than 1 minute
Upload Single Image
Description
The Upload Single Image API allows you to upload a single image file.
Endpoint
POST /v1/files/upload/single/image
Required Headers
{
"Authorization": "Bearer JWT_TOKEN",
"X-MerchantApiKey": "MERCHANT_API_KEY",
"Content-Type": "multipart/form-data"
}Example API Call (Fetch or Axios)
var formdata = new FormData();
formdata.append("file", fileInput.files[0], "product-image.jpeg");
var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};
fetch("{{url}}/v1/files/upload/single/image", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));📤 Sample 200 Response (Success)
{
"data": {
"id": "file_abc123xyz",
"name": "product-image.jpeg",
"url": "https://res.cloudinary.com/ibreathcode/image/upload/v1/product/images/hzafjkvoeq5iiltgqic5",
"type": "image/jpeg"
},
"message": "File uploaded successfully",
"status": true
}[!IMPORTANT]
Save theidfrom this response. It is required when creating or updating V2 products — pass it as theimage,thumbnail, orimageListfield value instead of a URL.
Next Steps
- Learn to Upload Multiple Images
