Images batch api gets error code 103 forbidden endpoint

Dear all,
I first created an API with:
All accounts - Stream:Read, Stream:Edit, Cloudflare Images:Read, Cloudflare Images:Edit, Account Analytics:Read, Access: Service Tokens:Read, Access: Service Tokens:Edit
Verified ok. I then get a batch token:
curl -H "Authorization: Bearer dfedHj6Yy1OXXXXXXXXXXXXXXXXXXX" \ "https://api.cloudflare.com/client/v4/accounts/MyAccountIDXXXXXXX/images/v1/batch_token"
And I get a token.
Then I try:
curl --url https://batch.imagedelivery.net/client/v4/accounts/MyAccountIDXXXXXX/images/v1 \
  --header 'Authorization: Bearer TheBatchTokenHere' \
  --form 'file=@"/MyFile.jpg"'

I get this:
 {"result":null,"success":false,"errors":[{"code":"103","message":"forbidden endpoint"}],"messages":[]}

Would you help?

I’m getting the same issue, unfortunately. As far as I can tell, this endpoint doesn’t actually work or the documentation for it is incorrect.

Hi all,

I find out why I got that error. I got the batch URL wrong. I should have call like this:
curl --url https://batch.imagedelivery.net/images/v1 --header ‘Authorization: Bearer Batch_Token_Here’ --form ‘file=@“/Myfile.jpg”’
Note that URI path is different from those of ordinary token.
Sorry for bother.

This topic was automatically closed after 15 days. New replies are no longer allowed.