Skip to main content
POST
/
dynamic-search-rules
List dynamic search rules
curl --request POST \
  --url http://localhost:7700/dynamic-search-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "offset": 1,
  "limit": 1,
  "filter": {
    "attribute_patterns": {
      "patterns": [
        "title",
        "overview_*",
        "release_date"
      ]
    },
    "active": true
  }
}
'
{
  "results": [
    {
      "uid": "black-friday",
      "description": "Black Friday 2025 rules",
      "priority": 10,
      "active": true,
      "conditions": [
        {
          "scope": "query",
          "isEmpty": true
        },
        {
          "scope": "time",
          "start": "2025-11-28T00:00:00Z",
          "end": "2025-11-28T23:59:59Z"
        }
      ],
      "actions": [
        {
          "selector": {
            "indexUid": "products",
            "id": "123"
          },
          "action": {
            "type": "pin",
            "position": 1
          }
        }
      ]
    }
  ],
  "offset": 0,
  "limit": 20,
  "total": 1
}

Authorizations

Authorization
string
header
required

An API key is a token that you provide when making API calls. Read more about how to secure your project.

Include the API key to the Authorization header, for instance:

-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'

If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:

const client = new MeiliSearch({
  host: 'MEILISEARCH_URL',
  apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});

Body

application/json
offset
integer

Number of rules to skip. Defaults to 0.

Required range: x >= 0
limit
integer

Maximum number of rules to return. Default to 20.

Required range: x >= 0
filter
object

Optional filter to restrict which rules are returned (e.g. by attribute patterns or by properties like if the rule is active or not)

Response

Dynamic search rules are returned.

results
object[]
required

Items for the current page.

offset
integer
required

Number of items skipped.

Required range: x >= 0
limit
integer
required

Maximum number of items returned.

Required range: x >= 0
total
integer
required

Total number of items matching the query.

Required range: x >= 0