Based on the documentation we can upload image file from our system(which are present locally). https://developers.facebook.com/docs/marketing-api/reference/ad-image
How to upload an image from an url to /adimages endpoint and get image-hash id?
Facebook does not allow direct URL access. But there is a workaround. You can post the image content in bytes format using the bytes option as described in the documentation.
Below is a curl command which worked for me :
curl -F 'bytes=iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAOVBMVEX///87WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZhMeMJEaa5Xi9tKdb0+Xp5Wi9tXjNxThNH+wk/7AAAACnRSTlMAsHIoaM7g/fx9Zr/g5QAAAGlJREFUeNplkFsOwCAIBPGJrtbX/Q/bqm1qwnxuJrBAE6OVD15pQy/WYePsDiIjp9FGyuC4DK7l6pOrVH4s41D6R4EzpJGXsa0MTQqp/yQo8hhHMuApoB1JQ5COnCN3yT6ys7xL3i7/cwMYsAveYa+MxAAAAABJRU5ErkJggg==' -F 'access_token=#ACCESS_TOKEN#' "https://graph.facebook.com/v13.0/#ACT_ID#/adimages"
To convert the image in bytes format you can use any language. Below is an example using PHP :
$bytes = base64_encode( file_get_contents( 'https://example.com/PATH/TO/image.jpg' ) );