Overview

This is a memo on some configuration settings for Strapi's REST API.

Changing the Search Result Limit

The following documentation describes this.

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.

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.