How to upload image using WordPress API?

I am trying to upload an image from an image URL using WordPress API but getting an error with the following message: {“code”:“rest_upload_sideload_error”,“message”:“Sorry, you are not allowed > to upload this file type.”,“data”:{“status”:500}}

I am using in key heading:

POST URL: https://example.com/wp-json/wp/v2/media 
Content-Disposition: attachment; filename="file.jpg"
Content-type: image/jpeg
Accept:  application/json
Cache-Control: no-cache

Body (JSON object):

{
“file”: “https://m.media-amazon.com/images/W/MEDIAX_792452-T1/images/I/71fBWvA3XlL._AC_SL1500_.jpg
“title”: “title of the image”
“caption”: “caption of the image”
“alt_text”: “alt of the image”
}