Skip to main content
GET
/
1
/
indexes
/
{indexName}
/
rules
/
{objectID}
curl
curl --request GET \
  --url https://algolia_application_id.algolia.net/1/indexes/ALGOLIA_INDEX_NAME/rules/lorem \
  --header 'accept: application/json' \
  --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
  --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID'
{
  "consequence": {
    "filterPromotes": false,
    "hide": [
      {
        "objectID": "test-record-123"
      }
    ],
    "params": {
      "advancedSyntax": false,
      "advancedSyntaxFeatures": [
        "exactPhrase",
        "excludeWords"
      ],
      "allowTyposOnNumericTokens": true,
      "alternativesAsExact": [
        "ignorePlurals",
        "singleWordSynonym"
      ],
      "analytics": true,
      "analyticsTags": [],
      "aroundLatLng": "40.71,-74.01",
      "aroundLatLngViaIP": false,
      "aroundPrecision": 10,
      "aroundRadius": 2,
      "attributeCriteriaComputedByMinProximity": false,
      "attributesToHighlight": [
        "author",
        "title",
        "conten",
        "content"
      ],
      "attributesToRetrieve": [
        "author",
        "title",
        "content"
      ],
      "attributesToSnippet": [
        "content:80",
        "description"
      ],
      "automaticFacetFilters": [
        {
          "facet": "<string>",
          "disjunctive": false,
          "score": 1
        }
      ],
      "automaticOptionalFacetFilters": [
        {
          "facet": "<string>",
          "disjunctive": false,
          "score": 1
        }
      ],
      "clickAnalytics": false,
      "decompoundQuery": true,
      "disableExactOnAttributes": [
        "description"
      ],
      "disableTypoToleranceOnAttributes": [
        "sku"
      ],
      "distinct": 1,
      "enableABTest": true,
      "enablePersonalization": false,
      "enableReRanking": true,
      "enableRules": true,
      "exactOnSingleWordQuery": "attribute",
      "facetFilters": [
        [
          "category:Book",
          "category:-Movie"
        ],
        "author:John Doe"
      ],
      "facetingAfterDistinct": false,
      "facets": [
        "*"
      ],
      "filters": "(category:Book OR category:Ebook) AND _tags:published",
      "getRankingInfo": false,
      "highlightPostTag": "</em>",
      "highlightPreTag": "<em>",
      "hitsPerPage": 20,
      "ignorePlurals": [
        "ca",
        "es"
      ],
      "insideBoundingBox": "<string>",
      "insidePolygon": [
        [
          47.3165,
          4.9665,
          47.3424,
          5.0201,
          47.32,
          4.9
        ],
        [
          40.9234,
          2.1185,
          38.643,
          1.9916,
          39.2587,
          2.0104
        ]
      ],
      "length": 500,
      "maxValuesPerFacet": 100,
      "minimumAroundRadius": 2,
      "minProximity": 1,
      "minWordSizefor1Typo": 4,
      "minWordSizefor2Typos": 8,
      "mode": "keywordSearch",
      "naturalLanguages": [],
      "numericFilters": [
        [
          "inStock = 1",
          "deliveryDate < 1441755506"
        ],
        "price < 1000"
      ],
      "offset": 123,
      "optionalFilters": [
        "category:Book",
        "author:John Doe"
      ],
      "optionalWords": "<string>",
      "page": 0,
      "percentileComputation": true,
      "personalizationImpact": 100,
      "query": {
        "edits": [
          {
            "delete": "<string>",
            "insert": "<string>"
          }
        ],
        "remove": [
          "<string>"
        ]
      },
      "queryLanguages": [
        "es"
      ],
      "queryType": "prefixLast",
      "ranking": [
        "typo",
        "geo",
        "words",
        "filters",
        "proximity",
        "attribute",
        "exact",
        "custom"
      ],
      "relevancyStrictness": 90,
      "removeStopWords": [
        "ca",
        "es"
      ],
      "removeWordsIfNoResults": "firstWords",
      "renderingContent": {
        "facetOrdering": {
          "facets": {
            "order": [
              "<string>"
            ]
          },
          "values": {}
        },
        "redirect": {
          "url": "<string>"
        },
        "widgets": {
          "banners": [
            {
              "image": {
                "title": "<string>",
                "urls": [
                  {
                    "url": "<string>"
                  }
                ]
              },
              "link": {
                "url": "<string>"
              }
            }
          ]
        }
      },
      "replaceSynonymsInHighlight": false,
      "reRankingApplyFilter": [
        "<unknown>"
      ],
      "responseFields": [
        "*"
      ],
      "restrictHighlightAndSnippetArrays": false,
      "restrictSearchableAttributes": [
        "title",
        "author"
      ],
      "ruleContexts": [
        "mobile"
      ],
      "semanticSearch": {
        "eventSources": [
          "<string>"
        ]
      },
      "similarQuery": "comedy drama crime Macy Buscemi",
      "snippetEllipsisText": "…",
      "sortFacetValuesBy": "count",
      "sumOrFiltersScores": false,
      "synonyms": true,
      "tagFilters": [
        [
          "Book",
          "Movie"
        ],
        "SciFi"
      ],
      "typoTolerance": true,
      "userToken": "test-user-123"
    },
    "promote": [
      {
        "objectIDs": [
          "test-record-123"
        ],
        "position": 0
      }
    ],
    "redirect": {
      "indexName": "<string>"
    },
    "userData": {
      "settingID": "f2a7b51e3503acc6a39b3784ffb84300",
      "pluginVersion": "1.6.0"
    }
  },
  "objectID": "<string>",
  "condition": {
    "alternatives": false,
    "context": "mobile",
    "filters": "genre:comedy",
    "pattern": "{facet:genre}"
  },
  "conditions": [
    {
      "alternatives": false,
      "context": "mobile",
      "filters": "genre:comedy",
      "pattern": "{facet:genre}"
    }
  ],
  "description": "Display a promotional banner",
  "enabled": true,
  "scope": "<string>",
  "tags": [
    "<string>"
  ],
  "validity": [
    {
      "from": 123,
      "until": 123
    }
  ]
}
To find the object ID of rules, use the search operation. Required ACL: settings

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Path Parameters

indexName
string
required

Name of the index on which to perform the operation.

Example:

"ALGOLIA_INDEX_NAME"

objectID
string
required

Unique identifier of a rule object.

Response

OK

Rule object.

consequence
object
required

Effect of the rule.

For more information, see Consequences.

objectID
string
required

Unique identifier of a rule object.

condition
object
deprecated

Legacy field for a single condition. This field is maintained for backward compatibility with older rules but should not be used in new implementations.

conditions
object[]

Conditions that trigger a rule.

Some consequences require specific conditions or don't require any condition. For more information, see Conditions.

Maximum array length: 25
description
string

Description of the rule's purpose to help you distinguish between different rules.

Example:

"Display a promotional banner"

enabled
boolean
default:true

Whether the rule is active.

scope
string
tags
string[]
validity
object[]

Time periods when the rule is active.

Last modified on March 23, 2026