Rest API To upload main image for item


I need to change the main image of Item through restful API,
Please find the example below it works fine to upload image as attachment but not the main image.

Kindly Advice.


Above method just upload/attach file against an item. You have to set this image to image field in Item form.
for this, you can take image path from above API response and Update Item form using PUT method API.