REST API parameters
API parameters can be used with the REST API to filter, sort, and paginate results and to select fields and relations to populate. Additionally, specific parameters related to optional Strapi features can be used, like the publication state and locale of a content-type.
The following API parameters are available:
|String or Object||Populate relations, components, or dynamic zones|
|Array||Select only specific fields to display|
|Object||Filter the response|
|String or Array||Select one or multiple locales|
|String||Select the Draft & Publish state|
Only accepts the following values:
|String or Array||Sort the response|
|Object||Page through entries|
Query parameters use the LHS bracket syntax (i.e. they are encoded using square brackets
A wide range of REST API parameters can be used and combined to query your content, which can result in long and complex query URLs.
👉 You can use Strapi's interactive query builder tool to build query URLs more conveniently. 🤗
In Strapi 4.13+, sending invalid query parameters will result in an error status instead of ignoring them. Please ensure that you are only querying fields that:
- are in the correct format for the parameter
- are not private or password fields
- you have read permission on
If you need your API to have the old behavior of ignoring invalid parameters, you will need to customize your controller to only sanitize and not validate.