Unauthorized error when trying to upload file through API V4

System Information
  • Strapi Version: 4.0.6
  • Operating System: MacOS
  • Database: PGSQL
  • Node Version: 14.15
  • NPM Version: 6.14

Hi everyone,

I’m currently trying to let a logged user with “Authenticated” role upload a file through the rest API.
I gave to users with this role the right to upload files through settings panel, however I keep having 401 Unauthorized response when I try to proceed to the update by uploading with the /upload endpoint and providing files as form data. I’ve double checked that the token is provided and I’ve also tried to do the same call with an Admin User Token and it seems to work.

Thank you for any help.

I resolved it, the error was that i was using /upload endpoint instead of api/upload. My bad :disappointed_relieved:

When I use the /api/upload endpoint I get a 500 error. Forbidden. What is the difference between “unauthorized” and “forbidden”?

If I change the endpoint to /api/upload then I receive an 400, Bad Request

My Strapi version is 4.1.3

I also have a similar issue with a plugin (strapi-stripe) when I try to upload an image, I get a 403 at the endpoint /api/upload