Cloudflare Docs
Cloudflare Image Optimization
Edit this page
Report an issue with this page
Log into the Cloudflare dashboard
Set theme to dark (⇧+D)

Upload via custom path

You can use a custom ID path to upload an image instead of the path automatically generated by Cloudflare Images’ Universal Unique Identifier (UUID).

Custom paths support:

Make a POST request using the example below as reference. You can use custom ID paths when you upload via a URL or with a direct file upload.

curl --request POST{account_id}/images/v1 \
--header "Authorization: Bearer <API_TOKEN>" \
--form 'url=https://<REMOTE_PATH_TO_IMAGE>' \
--form 'id=<PATH_TO_YOUR_IMAGE>'

After successfully uploading the image, you will receive a response similar to the example below.

"result": {
"filename": "<YOUR_IMAGE>",
"uploaded": "2022-04-20T09:51:09.559Z",
"requireSignedURLs": false,
"variants": ["<PATH_TO_YOUR_IMAGE>/public"]
"result_info": null,
"success": true,
"errors": [],
"messages": []