Set up API End User Permissions to Make REST Queries in Strapi

Daniel Phiri
InstructorDaniel Phiri
Share this video with your friends

Social Share Links

Send Tweet

We have a problem right now in that if you were to try and fetch these posts from the API, you would get a 403 error. And that's because we haven't set up the end user permissions for the API to be able to access this content. So let's go ahead and do that now.

We'll modify the User permissions for the Post role and give public access to find and findOne.

Instructor: [0:00] We want to be able to access the content that we added into our CMS via the API. In our browser, when we make a request to localhost:1337/api/posts and check our network, we get an error message saying, "Forbidden."

[0:19] To grant users access to the content via the API, we need to adjust our user permissions inside of Strapi. We'll go to Settings, and under Users & Permissions plugin, we'll click Roles, we'll click Public, and look for our post collection type. We'll click find and findOne to give users get access to posts for all posts and individual posts.

[0:45] We'll click Save and go back to our browser tab and refresh. When we check the response, we have the data that we just entered, entitled, "Accept Branch-out California Protocol to Genie." That is how you set up API end-user permissions in Strapi.