Overview
This is a memo on some configuration settings for Strapi's REST API.
Changing the Search Result Limit
The following documentation describes this.
Sort and Pagination | Strapi 5 Documentation
Use Strapi's REST API to sort or paginate your data.
Specifically:
The default and maximum values for pagination[limit] can be configured in the ./config/api.js file with the api.rest.defaultLimit and api.rest.maxLimit keys.
module.exports = {
rest: {
defaultLimit: 25,
maxLimit: 1000, // 100,
withCount: true,
},
};
Retrieving Items Including Those with Draft STATE
By default, items with a Draft STATE could not be retrieved. The following article was helpful.

Can I expose an collection entry in draft-mode in the api for a certain user
If you want to avoid creating the route/controller, you can already search for those through the API by adding this after your article โ ?_publicationState=preview&published_at_null=true Example: http://localhost:1337/articles?_publicationState=preview&published_at_null=true more info here โ Content API - Strapi Developer Documentation
Specifically, by adding the following query parameters, draft items could be retrieved.
?publicationState=preview&filters[publishedAt][$null]=true
Summary
We hope this is helpful when using Strapi.




Comments
โฆ