relates to #889
How to create and use a limited API token?
My global API key works but I don't want to use that for deployment from a server. So I've been trying to create a token with limited permissions.
Now, even when starting with the Edit Cloudflare Workers template, I don't manage to create a token with limited permissions that works with wrangler.

Could I be missing something?
Here's what I get
$ wrangler publish --verbose --env=production
Error: [ApiError { code: 10000, message: "Authentication error", other: {} }]
$ wrangler publish --verbose # This is on workers.dev
Error: [ApiError { code: 10000, message: "Authentication error", other: {} }]
Would be nice to get more verbosity on the error message if possible.
Try updating to 1.6.0! We _just_ released support for this very feature today :) Let us know if you run into any issues
Oh nice. Unfortunately I get the same error. (I updated the issue with the commands I used and errors, around the same time you replied.)
And the global key works fine. (Well, good enough, I'm on a slow connection, so I get stuff like Error: Failed to upload file batch. ⚠️ Error: https://api.cloudflare.com/client/v4/accounts/............./stor
age/kv/namespaces/.........../bulk: timed out. Which is another issue...)
When you updated, did you re-run wrangler config and paste your limited API token?
No I simply edited ~/.wrangler/config/default.toml - so my email was still in there.
It might help to throw an error mentioning that the email var can't be set if it's a limited API token?
Thanks!
Makes sense! Glad we could help :) Please come back if you run into any other issues!
Hey @guaka - how did you solve the issue? I have the exact same issue here:
[simplenotezy:~/Projects/my-site]$ wrangler publish (master✱)
🌀 Using namespace for Workers Site "__my-site-workers_sites_assets"
🌀 Uploading site files
Error: Failed to upload file batch. ⚠️ Error: error sending request for url (https://api.cloudflare.com/client/v4/accounts/XXXX/storage/kv/namespaces/XXXX/bulk): operation timed out
I got no clue why.
@simplenotezy I solved it by not using Wrangler and Workers.
Most helpful comment
@simplenotezy I solved it by not using Wrangler and Workers.