> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a rule

> Retrieve a rule.



## OpenAPI

````yaml /api-reference/saas/cs-rules-rewrites.json get /em-rules/{id}
openapi: 3.0.3
info:
  title: Rules & Rewrites API
  description: >-
    Manage Commerce Studio rules and query rewrites. Rules control search result
    behavior including boosting, burying, pinning, redirects, banners, and facet
    configuration. Query rewrites handle synonym expansion, misspelling
    correction, phrase matching, and query term manipulation.


    The endpoints require an authentication token with scope
    `commercestudio.rules` for rule operations and `commercestudio.rewrites` for
    query rewrite operations.
  version: 1.0.0
  contact:
    name: Lucidworks
    url: https://lucidworks.com/
    email: support@lucidworks.com
servers:
  - url: https://{commerce_studio_id}.experiencemanager.lucidworks.com
    description: Production.
    variables:
      commerce_studio_id:
        default: commerce_studio_id
        description: The ID of your Commerce Studio instance.
security:
  - authToken: []
tags:
  - name: Rule Management
    description: Create/Read/Update/Delete (CRUD) operations for Commerce Studio rules.
  - name: Query Rewrite Management
    description: >-
      Create/Read/Update/Delete (CRUD) operations for Commerce Studio query
      rewrites.
paths:
  /em-rules/{id}:
    get:
      tags:
        - Rule Management
      summary: Get a rule
      description: Retrieve a rule.
      operationId: getRule
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: >-
            The rule's Universally-Unique Identifier (UUID). You can also use
            the `externalId`, if the rule has one.
        - name: fields
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - TARGETED_DOCUMENTS
                - CONFLICTS
                - IS_PENDING_BULK_OPERATION
                - FUSION_SYNC_STATUS
                - MIGRATION
          description: >-
            Optional additional fields to include in the response. Keep in mind
            that additional fields can slow the call and increase the response
            size.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BannerRuleSummary'
                  - $ref: '#/components/schemas/BlockByAttributeRuleSummary'
                  - $ref: '#/components/schemas/BlockListRuleSummary'
                  - $ref: '#/components/schemas/BoostAttributesRuleSummary'
                  - $ref: '#/components/schemas/BoostListRuleSummary'
                  - $ref: '#/components/schemas/BuryAttributesRuleSummary'
                  - $ref: '#/components/schemas/BuryListRuleSummary'
                  - $ref: '#/components/schemas/FilterListRuleSummary'
                  - $ref: '#/components/schemas/InGroupBoostListRuleSummary'
                  - $ref: '#/components/schemas/InGroupBuryListRuleSummary'
                  - $ref: '#/components/schemas/InGroupPinRuleSummary'
                  - $ref: '#/components/schemas/JsonBlobRuleSummary'
                  - $ref: '#/components/schemas/PinRuleSummary'
                  - $ref: '#/components/schemas/RedirectRuleSummary'
                  - $ref: '#/components/schemas/ResponseValueRuleSummary'
                  - $ref: '#/components/schemas/SetJSONFacetsRuleSummary'
                  - $ref: '#/components/schemas/SetParamsRuleSummary'
                discriminator:
                  propertyName: type
                  mapping:
                    BANNER:
                      $ref: '#/components/schemas/BannerRuleSummary'
                    BLOCK_BY_ATTRIBUTE:
                      $ref: '#/components/schemas/BlockByAttributeRuleSummary'
                    BLOCK_LIST:
                      $ref: '#/components/schemas/BlockListRuleSummary'
                    BOOST_ATTRIBUTES:
                      $ref: '#/components/schemas/BoostAttributesRuleSummary'
                    BOOST_LIST:
                      $ref: '#/components/schemas/BoostListRuleSummary'
                    BURY_ATTRIBUTES:
                      $ref: '#/components/schemas/BuryAttributesRuleSummary'
                    BURY_LIST:
                      $ref: '#/components/schemas/BuryListRuleSummary'
                    FILTER_LIST:
                      $ref: '#/components/schemas/FilterListRuleSummary'
                    IN_GROUP_BOOST_LIST:
                      $ref: '#/components/schemas/InGroupBoostListRuleSummary'
                    IN_GROUP_BURY_LIST:
                      $ref: '#/components/schemas/InGroupBuryListRuleSummary'
                    IN_GROUP_PIN:
                      $ref: '#/components/schemas/InGroupPinRuleSummary'
                    JSON_BLOB:
                      $ref: '#/components/schemas/JsonBlobRuleSummary'
                    PIN:
                      $ref: '#/components/schemas/PinRuleSummary'
                    REDIRECT:
                      $ref: '#/components/schemas/RedirectRuleSummary'
                    RESPONSE_VALUE:
                      $ref: '#/components/schemas/ResponseValueRuleSummary'
                    SET_JSON_FACETS:
                      $ref: '#/components/schemas/SetJSONFacetsRuleSummary'
                    SET_PARAMS:
                      $ref: '#/components/schemas/SetParamsRuleSummary'
        '404':
          description: Rule not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BannerRuleSummary:
      title: BannerRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            url:
              type: string
              description: Banner rule URL.
            zone:
              type: string
              description: Banner rule zone.
      description: Displays a banner in the search results when rule criteria match.
    BlockByAttributeRuleSummary:
      title: BlockByAttributeRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            fieldValues:
              type: array
              description: >-
                The values for the specified `fieldName`. Behavior depends on
                the rule type. For example, a boost rule would use these values
                to boost documents with matching field values.
              example:
                - value1
                - value2
              items:
                type: string
                example: value1
            termsQuerySeparator:
              type: string
              description: >-
                Separator delimiting the values in the terms query string,
                defaulting to a comma.
              default: ','
            termsQueryMethod:
              type: string
              description: >-
                Solr query execution method for matching terms.

                - `termsFilter` (default): Uses BooleanQuery or TermInSetQuery
                based on term count. Scales well with index size, moderately
                with number of terms.

                - `booleanQuery`: Creates a BooleanQuery. Scales well with index
                size, poorly with many terms.

                - `automaton`: Creates an AutomatonQuery. Scales well with index
                size and moderately with number of terms.

                - `docValuesTermsFilter`: Requires docValues-enabled fields.
                Automatically chooses optimal strategy based on term count.
              default: termsFilter
              enum:
                - termsFilter
                - booleanQuery
                - automaton
                - docValuesTermsFilter
            blockGroupsList:
              type: array
              description: >-
                A list of block group chains combined with OR logic. Each chain
                contains `block_groups` (conditions with AND/OR logic) and an
                optional `boost_factor` (ignored for blocking). Multiple chains
                are ORed together. Supports `EQUAL`, `GREATER_THAN`,
                `LESS_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN_OR_EQUAL`,
                `BETWEEN`, `NOT_EQUAL` operators.
              example:
                - blockGroups:
                    - blocks:
                        - field: brand
                          operator: EQUAL
                          value: nike
                      operator: OR
                  boostFactor: 1
              items:
                $ref: '#/components/schemas/BlockGroupsChainSummary'
      description: >-
        Blocks one or more documents that match the rule criteria in the search
        results, where rule criteria is an attribute (for example, `Color`) and
        list of values to block.
    BlockListRuleSummary:
      title: BlockListRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            fieldValues:
              type: array
              description: >-
                The values for the specified `fieldName`. Behavior depends on
                the rule type. For example, a boost rule would use these values
                to boost documents with matching field values.
              example:
                - value1
                - value2
              items:
                type: string
                example: value1
            termsQuerySeparator:
              type: string
              description: >-
                Separator delimiting the values in the terms query string,
                defaulting to a comma.
              default: ','
            termsQueryMethod:
              type: string
              description: >-
                Solr query execution method for matching terms.

                - `termsFilter` (default): Uses BooleanQuery or TermInSetQuery
                based on term count. Scales well with index size, moderately
                with number of terms.

                - `booleanQuery`: Creates a BooleanQuery. Scales well with index
                size, poorly with many terms.

                - `automaton`: Creates an AutomatonQuery. Scales well with index
                size and moderately with number of terms.

                - `docValuesTermsFilter`: Requires docValues-enabled fields.
                Automatically chooses optimal strategy based on term count.
              default: termsFilter
              enum:
                - termsFilter
                - booleanQuery
                - automaton
                - docValuesTermsFilter
      description: >-
        Blocks one or more documents that match the rule criteria from appearing
        in the search results, where rule criteria is a field (for example,
        `id`) and list of values to block.
    BoostAttributesRuleSummary:
      title: BoostAttributesRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            boostParam:
              type: string
              description: >-
                The boost param to use, either: bq (additive) or boost
                (multiplicative). Part of simple format, ignored when
                `blockGroupsList` is present.
            boostQuery:
              type: string
              description: >-
                The boost query to use. Part of simple format, ignored when
                `blockGroupsList` is present.
            blockGroupsList:
              type: array
              description: >-
                A list of block group chains combined with OR logic. Each chain
                contains `block_groups` (conditions with AND/OR logic) and a
                `boost_factor`. Multiple chains are ORed together, each with its
                own boost factor. When present, this takes precedence over
                `boostParam`/`boostQuery`.
              items:
                $ref: '#/components/schemas/BlockGroupsChainSummary'
      description: >-
        Boosts by either simple format (`boostParam`/`boostQuery`) or structured
        format (`block_groups_list`). When `block_groups_list` is present, it
        takes precedence over `boostParam`/`boostQuery`.
    BoostListRuleSummary:
      title: BoostListRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            fieldValues:
              type: array
              description: >-
                The values for the specified `fieldName`. Behavior depends on
                the rule type. For example, a boost rule would use these values
                to boost documents with matching field values.
              example:
                - value1
                - value2
              items:
                type: string
                example: value1
            useQec:
              type: boolean
              description: >-
                Set to `true` to use query elevation to force-elevate documents
                to the top.

                Query elevation only supports elevation through the `id` field.
                Failure to configure query elevation correctly while having this
                box checked will cause this rule to stop working.
              default: false
      description: >-
        Boosts one or more documents that match the rule criteria in the search
        results where rule criteria is a field (for example, `id`) and list of
        values to boost.
    BuryAttributesRuleSummary:
      title: BuryAttributesRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            boostParam:
              type: string
              description: >-
                The boost param to use, either: bq (additive) or boost
                (multiplicative).
            boostQuery:
              type: string
              description: >-
                The boost query to use. Use a negative boost value to decrease
                the score and bury matching documents.
      description: >-
        Buries documents by either `bq` or by boosting documents that match a
        user-supplied query.
    BuryListRuleSummary:
      title: BuryListRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            fieldValues:
              type: array
              description: >-
                The values for the specified `fieldName`. Behavior depends on
                the rule type. For example, a boost rule would use these values
                to boost documents with matching field values.
              example:
                - value1
                - value2
              items:
                type: string
                example: value1
      description: >-
        Downweights one or more documents that match the rule criteria in the
        search results, where rule criteria is a field (for example, `id`) and
        list of values to bury.
    FilterListRuleSummary:
      title: FilterListRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            fieldValues:
              type: array
              description: >-
                The values for the specified `fieldName`. Behavior depends on
                the rule type. For example, a boost rule would use these values
                to boost documents with matching field values.
              example:
                - value1
                - value2
              items:
                type: string
                example: value1
            useQec:
              type: boolean
              description: >-
                Set to `true` to use query elevation to force-elevate documents
                to the top.

                Query elevation only supports elevation through the `id` field.
                Failure to configure query elevation correctly while having this
                box checked will cause this rule to stop working.
              default: false
            termsQuerySeparator:
              type: string
              description: >-
                Separator delimiting the values in the terms query string,
                defaulting to a comma.
              default: ','
            termsQueryMethod:
              type: string
              description: >-
                Solr query execution method for matching terms.

                - `termsFilter` (default): Uses BooleanQuery or TermInSetQuery
                based on term count. Scales well with index size, moderately
                with number of terms.

                - `booleanQuery`: Creates a BooleanQuery. Scales well with index
                size, poorly with many terms.

                - `automaton`: Creates an AutomatonQuery. Scales well with index
                size and moderately with number of terms.

                - `docValuesTermsFilter`: Requires docValues-enabled fields.
                Automatically chooses optimal strategy based on term count.
              default: termsFilter
              enum:
                - termsFilter
                - booleanQuery
                - automaton
                - docValuesTermsFilter
      description: >-
        Filters one or more documents that match the rule criteria in the search
        results, where rule criteria is a field (for example, `id`) and list of
        values to boost.
    InGroupBoostListRuleSummary:
      title: InGroupBoostListRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            fieldValues:
              type: array
              description: >-
                The values for the specified `fieldName`. Behavior depends on
                the rule type. For example, a boost rule would use these values
                to boost documents with matching field values.
              example:
                - value1
                - value2
              items:
                type: string
                example: value1
            groupField:
              type: string
              description: >-
                The single field name that must be grouped on for this rule to
                be applied.
      description: Boosts one or more documents within its group in the search response.
    InGroupBuryListRuleSummary:
      title: InGroupBuryListRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            fieldValues:
              type: array
              description: >-
                The values for the specified `fieldName`. Behavior depends on
                the rule type. For example, a boost rule would use these values
                to boost documents with matching field values.
              example:
                - value1
                - value2
              items:
                type: string
                example: value1
            groupField:
              type: string
              description: >-
                The single field name that must be grouped on for this rule to
                be applied.
      description: Buries one or more documents within its group in the search response.
    InGroupPinRuleSummary:
      title: InGroupPinRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            pinnedValues:
              type: array
              description: >-
                A list of one or more documents to boost and pin to specific
                positions in the results (position 1 is the first position, 2 is
                the second, and so on).
              items:
                $ref: '#/components/schemas/PinnedValueSummary'
              default: []
            groupField:
              type: string
              description: >-
                The single field name that must be grouped on for this rule to
                be applied.
            groupValue:
              type: string
              description: >-
                A single group value in which the pin rule will apply to the
                documents.
      description: >-
        Like `InGroupBoostListRule`, but pins a document within a group to a
        specific position.
    JsonBlobRuleSummary:
      title: JsonBlobRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            blobType:
              type: string
              description: >-
                Indicates what kind of data this blob contains. This only has an
                effect if your frontend has been developed to utilize this
                field. You will need to know what the possible values are and
                what effect they have on your frontend.
            jsonBlob:
              type: string
              description: Arbitrary JSON blob.
      description: Returns an arbitrary JSON blob alongside the response.
    PinRuleSummary:
      title: PinRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            targetedDocumentGroups:
              type: array
              description: The documents that the rule targets.
              example:
                - id: doc1
                - id: doc2
              items:
                $ref: '#/components/schemas/TargetedDocumentGroupSummary'
            targetedDocumentsErrorMessage:
              type: string
              description: >-
                The error message if there was an error retrieving the targeted
                documents.
            targetedDocumentsQueryUrl:
              type: string
              description: The URL that was used to query for the targeted documents.
            targetedDocumentsFormParams:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
                description: Optional additional properties.
              description: >-
                The form parameters that were used to query for the targeted
                documents.
            targetedDocumentsBody:
              $ref: '#/components/schemas/FusionPreviewQueryRequest'
            fieldName:
              type: string
              description: The name of the field to which the rule applies.
              example: title_s
            pinnedValues:
              type: array
              description: >-
                A list of one or more documents to boost and pin to specific
                positions in the results (position 1 is the first position, 2 is
                the second, and so on).
              items:
                $ref: '#/components/schemas/PinnedValueSummary'
              default: []
            useQec:
              type: boolean
              description: >-
                Set to `true` to use query elevation to force-elevate documents
                to the top.

                Query elevation only supports elevation through the `id` field.
                Failure to configure query elevation correctly while having this
                box checked will cause this rule to stop working.
              default: false
      description: >-
        Details about the pin rule. Boosts documents and then pins the matching
        values to absolute positions in the result set.
    RedirectRuleSummary:
      title: RedirectRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            url:
              type: string
              description: Path or URL to redirect the response to.
      description: Returns a URL for the redirect when this rule is triggered.
    ResponseValueRuleSummary:
      title: ResponseValueRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
      description: Add arbitrary response values to the query response.
    SetJSONFacetsRuleSummary:
      title: SetJSONFacetsRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            fieldFacets:
              type: array
              description: Field facet configurations.
              items:
                $ref: '#/components/schemas/FieldFacetConfigSummary'
            rangeFacets:
              type: array
              description: Range facet configurations.
              items:
                $ref: '#/components/schemas/RangeFacetConfigSummary'
      description: >-
        Details about the set JSON facets rule. Configure JSON facet API
        parameters for the current query.
    SetParamsRuleSummary:
      title: SetParamsRuleSummary
      allOf:
        - $ref: '#/components/schemas/BaseRuleSummary'
        - type: object
          properties:
            params:
              type: array
              description: Modifications to make to the request parameters.
              items:
                $ref: '#/components/schemas/ParamAndValueSummary'
      description: Modify the parameters of the current request.
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message describing what went wrong.
        timestamp:
          type: string
          description: When the error occurred (ISO 8601 format).
          format: date-time
        status:
          type: integer
          description: HTTP status code.
        error:
          type: string
          description: HTTP status text (e.g., "Bad Request", "Not Found").
        path:
          type: string
          description: API endpoint path that generated the error.
      title: ErrorResponse
    BaseRuleSummary:
      type: object
      title: BaseRuleSummary
      description: Common properties shared by all rule summary types.
      properties:
        additionalProperties:
          type: object
          description: Optional additional properties.
        conditionType:
          type: string
          description: >-
            Commerce Studio Rule condition type to distinguish between rules
            created for search versus rules created for category-based
            merchandising. Ignored within `stagingContent`.
          enum:
            - SEARCH
            - CATEGORY
        conditions:
          $ref: '#/components/schemas/ConditionsSummary'
        conflicts:
          type: array
          description: Rules with conflicting/overlapping conditions.
          items:
            oneOf:
              - $ref: '#/components/schemas/BannerRuleSummary'
              - $ref: '#/components/schemas/BlockByAttributeRuleSummary'
              - $ref: '#/components/schemas/BlockListRuleSummary'
              - $ref: '#/components/schemas/BoostAttributesRuleSummary'
              - $ref: '#/components/schemas/BoostListRuleSummary'
              - $ref: '#/components/schemas/BuryAttributesRuleSummary'
              - $ref: '#/components/schemas/BuryListRuleSummary'
              - $ref: '#/components/schemas/FilterListRuleSummary'
              - $ref: '#/components/schemas/InGroupBoostListRuleSummary'
              - $ref: '#/components/schemas/InGroupBuryListRuleSummary'
              - $ref: '#/components/schemas/InGroupPinRuleSummary'
              - $ref: '#/components/schemas/JsonBlobRuleSummary'
              - $ref: '#/components/schemas/PinRuleSummary'
              - $ref: '#/components/schemas/RedirectRuleSummary'
              - $ref: '#/components/schemas/ResponseValueRuleSummary'
              - $ref: '#/components/schemas/SetJSONFacetsRuleSummary'
              - $ref: '#/components/schemas/SetParamsRuleSummary'
        createdBy:
          type: string
          description: User who created the entity.
        creationDate:
          type: string
          description: Date when the entity was created.
          format: date-time
        deleted:
          type: boolean
          description: >-
            Mark the rule as deleted without fully removing it from the system
            (if this is true or `markedForDeletion` is true). Unlike
            `markedForDeletion`, this is a writeable field.
        description:
          type: string
          description: A rule description.
        externalId:
          type: string
          description: >-
            An optional ID set by external users of the API at creation time.
            Cannot be changed after creation.
        groups:
          type: array
          description: >-
            A method of rule organization. Rules can be part of multiple rule
            groups.
          items:
            type: string
        hasConflicts:
          type: boolean
          description: >-
            It should be true when there is any conflict this rule has with
            other rules in this Commerce Studio instance.
        id:
          type: string
          description: Entity ID.
          format: uuid
        lastModified:
          type: string
          description: Date when the entity was last updated.
          format: date-time
        lastModifiedBy:
          type: string
          description: User who last updated the entity.
        liveFusionSyncStatus:
          $ref: '#/components/schemas/FusionSyncStatusSummary'
        markedForDeletion:
          type: boolean
          description: >-
            This is `true` if this rule is marked for deletion (`deleted` is
            `true`) but has not yet been fully removed from the system. This is
            only `true` in rare cases, and usually the system automatically
            resolves it. If not, you can use this key for troubleshooting. It is
            set internally by the system and is read-only. Rules in this state
            (`true`) do not appear in the listing endpoints (other than `GET` by
            ID) unless explicitly requested to be included.
        matchSearchQueryUsing:
          type: string
          description: >-
            Defines how the specified search terms will be compared to the
            user's query to determine whether this rule applies.
          example: KEYWORDS
          enum:
            - KEYWORDS
            - TEXT
            - PHRASE
            - STARTS_WITH
            - ENDS_WITH
          default: KEYWORDS
        migratedId:
          type: string
          description: >-
            If this was originally migrated from another system, this field
            shows the ID of the original rule.
        migration:
          $ref: '#/components/schemas/MigrationSummary'
        name:
          type: string
          description: Entity name.
        pendingBulkOperation:
          type: boolean
          description: >-
            Whether this rule is currently pending in a bulk operation (such as
            being published, unpublished, or deleted). This is used to indicate
            that the rule should not be modified until the operation is
            complete. Once the rule reaches a terminal status in the operation,
            this will be set to `false`.
        precedence:
          type: integer
          description: >-
            Specifies the rule's precedence when multiple rules could apply to
            the same query.


            Higher values indicate higher precedence: the rule with the highest
            precedence is applied last and takes final effect. For example, a
            rule with precedence 3 will override a rule with precedence 2.


            If two rules have the same precedence, the more recently created
            rule takes precedence.
          format: int32
        publishState:
          type: string
          description: >-
            The publish state of the rule: `DRAFT` (unpublished), `PUBLISHED`
            (published with no staged changes), or `PUBLISHED_WITH_DRAFT_EDITS`
            (published but with pending changes in staging).
          enum:
            - DRAFT
            - PUBLISHED
            - PUBLISHED_WITH_DRAFT_EDITS
        published:
          type: boolean
          description: Whether the rule is staged or published.
        responseValues:
          type: array
          description: A list of key-value pairs representing response values.
          items:
            $ref: '#/components/schemas/KeyValueSummary'
        segments:
          type: array
          description: The segments that this rule will apply to.
          items:
            $ref: '#/components/schemas/SegmentSummary'
        stagingContent:
          description: >-
            A version of the rule that should be applied only to the staging
            view of Commerce Studio. This allows draft changes to be previewed
            prior to publishing. Changes made to this content are not visible in
            the live environment.
          oneOf:
            - $ref: '#/components/schemas/BannerRuleSummary'
            - $ref: '#/components/schemas/BlockByAttributeRuleSummary'
            - $ref: '#/components/schemas/BlockListRuleSummary'
            - $ref: '#/components/schemas/BoostAttributesRuleSummary'
            - $ref: '#/components/schemas/BoostListRuleSummary'
            - $ref: '#/components/schemas/BuryAttributesRuleSummary'
            - $ref: '#/components/schemas/BuryListRuleSummary'
            - $ref: '#/components/schemas/FilterListRuleSummary'
            - $ref: '#/components/schemas/InGroupBoostListRuleSummary'
            - $ref: '#/components/schemas/InGroupBuryListRuleSummary'
            - $ref: '#/components/schemas/InGroupPinRuleSummary'
            - $ref: '#/components/schemas/JsonBlobRuleSummary'
            - $ref: '#/components/schemas/PinRuleSummary'
            - $ref: '#/components/schemas/RedirectRuleSummary'
            - $ref: '#/components/schemas/ResponseValueRuleSummary'
            - $ref: '#/components/schemas/SetJSONFacetsRuleSummary'
            - $ref: '#/components/schemas/SetParamsRuleSummary'
        stagingFusionSyncStatus:
          $ref: '#/components/schemas/FusionSyncStatusSummary'
        tags:
          type: array
          description: >-
            A set of short, descriptive labels for categorization or quick
            reference.
          items:
            type: string
        type:
          type: string
          description: Rule type. Determines which schema applies.
          enum:
            - BANNER
      required:
        - type
    TargetedDocumentGroupSummary:
      type: object
      properties:
        fieldValue:
          type: string
          description: The field value.
        representatives:
          type: array
          description: >-
            Up to 3 arbitrarily-chosen representative documents of the group.
            This contains the raw document contents.
          example:
            - id: doc1
            - id: doc2
          items:
            type: object
        memberCount:
          type: integer
          description: The number of documents in the group.
          format: int32
      description: The documents targeted by the rule for a specific field value.
      example:
        id: doc1
      title: TargetedDocumentGroupSummary
    FusionPreviewQueryRequest:
      type: object
      properties:
        stageOverrides:
          $ref: '#/components/schemas/ArrayNode'
        executionModifiers:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonNode'
          description: >-
            Modifiers for the query execution. This is simply passed through as
            `executionModifiers` and is not validated. Be sure to verify that
            the modifiers are valid.
          example:
            rules.suppressed:
              9d6b8d0d-802b-4563-8d5f-ce26de91802b: true
              8d6b8d0d-802b-4563-8d5f-ce26de91802b: true
              36b173ca-02f7-456f-9f4a-070d9d028b96: true
        params:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonNode'
          description: Query parameters to be passed in the body.
      description: >-
        The body of the request that was sent to the preview endpoint to
        retrieve the targeted documents.
      title: FusionPreviewQueryRequest
    BlockGroupsChainSummary:
      type: object
      properties:
        boostFactor:
          type: number
          description: >-
            Boost factor (default 1.0, only used for boost rules, ignored for
            block rules).
          format: double
        blockGroups:
          type: array
          description: Block groups in this chain.
          items:
            $ref: '#/components/schemas/BlockGroupSummary'
      description: >-
        A chain of block groups with an associated boost factor. Multiple chains
        are combined with OR logic.
      title: BlockGroupsChainSummary
    PinnedValueSummary:
      required:
        - position
        - value
      type: object
      properties:
        value:
          type: string
        position:
          type: integer
          description: >-
            Position in search results (1 is the first position, 2 is the
            second, and so on).
          format: int32
      description: Pinned value and position.
      default:
        value: example-value
        position: 1
      title: PinnedValueSummary
    FieldFacetConfigSummary:
      type: object
      properties:
        field:
          type: string
          description: The field to facet on.
        rollupFieldCount:
          type: string
          description: Field name to use for rollup count aggregation.
        filterExclusion:
          type: boolean
          description: Whether to exclude this facet from filtering constraints.
        displayZeroCount:
          type: boolean
          description: Whether to display facet values with zero count.
        boostValues:
          type: array
          description: A list of facet values to boost to the top, in order.
          items:
            type: string
        buryValues:
          type: array
          description: A list of facet values to bury to the bottom, in order.
          items:
            type: string
        suppressValues:
          type: array
          description: A list of facet values to suppress (remove) from results.
          items:
            type: string
        prefix:
          type: string
          description: Prefix to apply to facet values.
        sort:
          type: string
          description: Sort order for facet values (`COUNT` or `INDEX`).
          enum:
            - COUNT
            - INDEX
        limit:
          type: integer
          description: Maximum number of facet values to return.
          format: int32
        offset:
          type: integer
          description: Starting offset for facet values.
          format: int32
        mincount:
          type: integer
          description: Minimum count threshold for facet values to be included.
          format: int32
        missing:
          type: boolean
          description: Whether to include a missing value facet.
        method:
          type: string
          description: >-
            Method for computing field facets (`ENUM`, `FC`, `FCS`, `DOCVALUES`,
            `UIF`, `SMART`).
          enum:
            - SMART
            - ENUM
            - FC
            - FCS
            - UIF
            - DVHASH
      description: Field facet configuration for JSON facets.
      title: FieldFacetConfigSummary
    RangeFacetConfigSummary:
      type: object
      properties:
        field:
          type: string
          description: The field to facet on.
        rollupFieldCount:
          type: string
          description: Field name to use for rollup count aggregation.
        filterExclusion:
          type: boolean
          description: Whether to exclude this facet from filtering constraints.
        displayZeroCount:
          type: boolean
          description: Whether to display facet values with zero count.
        boostValues:
          type: array
          description: A list of facet values to boost to the top, in order.
          items:
            type: string
        buryValues:
          type: array
          description: A list of facet values to bury to the bottom, in order.
          items:
            type: string
        suppressValues:
          type: array
          description: A list of facet values to suppress (remove) from results.
          items:
            type: string
        start:
          type: string
          description: Start value for the range (supports date math).
        end:
          type: string
          description: End value for the range (supports date math).
        gap:
          type: string
          description: Gap/interval between range buckets.
        hardend:
          type: boolean
          description: >-
            Whether to use hard end boundary (stop at end value even if gap
            doesn't divide evenly).
        include:
          type: array
          description: >-
            Which boundaries to include in ranges (lower, upper, edge, outer,
            all).
          items:
            type: string
            enum:
              - LOWER
              - UPPER
              - EDGE
              - OUTER
              - ALL
        other:
          type: array
          description: Other range options.
          items:
            type: string
            enum:
              - BEFORE
              - AFTER
              - BETWEEN
              - NONE
              - ALL
      description: Range facet configuration for JSON facets.
      title: RangeFacetConfigSummary
    ParamAndValueSummary:
      type: object
      properties:
        name:
          type: string
          description: Parameter name.
        value:
          type: string
          description: Parameter value.
        updatePolicy:
          type: string
          description: Parameter update policy.
          enum:
            - APPEND
            - REMOVE
            - REPLACE
            - DEFAULT
          default: APPEND
      description: Param and value.
      title: ParamAndValueSummary
    ConditionsSummary:
      type: object
      properties:
        queries:
          type: array
          description: >-
            Sets of search terms that triggers this rule. Matching logic depends
            on the `matchSearchQueryUsing` value.
          example:
            - shirts
            - pants
          items:
            type: string
            example: shirts
        fieldValues:
          type: array
          description: >-
            Determines which filters (`fq` parameters), when specified, will
            trigger this rule (for example when a query has an `fq` parameter
            with a value of `category:Shirts`).
          example:
            - field: category
              value: Shirts
              name: example_field
          items:
            $ref: '#/components/schemas/FieldValueSummary'
        queryProfiles:
          type: array
          description: Query profile IDs for which this rule can trigger.
          example:
            - MyQueryProfile
          items:
            type: string
            example: MyQueryProfile
        effectiveStart:
          type: string
          description: >-
            Together with `effectiveEnd`, determines the time frame in which
            this rule is active. Either can be null to indicate no limit in that
            direction.
          format: date-time
        effectiveEnd:
          type: string
          description: >-
            Together with `effectiveStart`, determines the time frame in which
            this rule is active. Either can be null to indicate no limit in that
            direction.
          format: date-time
      description: Conditions for the rule.
      title: ConditionsSummary
    FusionSyncStatusSummary:
      type: object
      properties:
        version:
          type: string
          description: >-
            Current latest version of this content (timestamp taken when this
            content was last changed).

            This is not guaranteed to be the same as the `lastModified` time and
            should not be used as the Entity Tag (ETag) version, as this tracks
            when this individual rule content (staging or live) was changed,
            regardless of whether the rule itself was changed.

            For example, this version wouldn't be updated when this is the
            staging state of the rule and the live version of this rule's
            content is changed.
          format: date-time
        lastSyncedVersion:
          type: string
          description: Version of this content that was last successfully synced.
          format: date-time
        fusionVersion:
          type: string
          description: >-
            Version received when the last successful sync was performed.

            This value comes from the underlying search engine's optimistic
            concurrency mechanism.
      description: Status of this rule's (staging or live contents) synchronization.
      title: FusionSyncStatusSummary
    MigrationSummary:
      type: object
      properties:
        sourceId:
          type: string
          description: The ID of the original rule in the source Commerce Studio instance.
          format: uuid
        sourceEmInstanceId:
          type: string
          description: >-
            The ID of the source Commerce Studio instance where the rule was
            migrated from.
          format: uuid
        sourceBulkOperationId:
          type: string
          description: >-
            The ID of the bulk operation that migrated this rule from the source
            Commerce Studio instance.
          format: uuid
      description: >-
        Rule migration tracking information for rules that have been migrated
        from one Commerce Studio instance to another.
      title: MigrationSummary
    KeyValueSummary:
      required:
        - key
        - value
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      description: The key and value.
      title: KeyValueSummary
    SegmentSummary:
      type: object
      properties:
        id:
          type: string
          description: Entity ID.
          format: uuid
        createdBy:
          type: string
          description: User who created the entity.
        creationDate:
          type: string
          description: Date when the entity was created.
          format: date-time
        lastModifiedBy:
          type: string
          description: User who last updated the entity.
        lastModified:
          type: string
          description: Date when the entity was last updated.
          format: date-time
        name:
          type: string
          description: Entity name.
        value:
          type: string
          description: >-
            Value used at query time to target this segment. Cannot be changed
            after creation.
        type:
          type: string
          description: Arbitrary categorization of the segment.
        ruleCount:
          type: integer
          description: >-
            Number of rules associated with this segment, via either the rule's
            staging or live content.
          format: int64
      description: Details about the segment.
      title: SegmentSummary
    ArrayNode:
      type: object
      description: >-
        Overrides for the query pipeline stages. This is simply passed through
        as `stageOverrides` and is not validated. Be sure to verify that the
        overrides are valid.
      title: ArrayNode
    JsonNode:
      type: object
      description: Query parameters to be passed in the body.
      title: JsonNode
    BlockGroupSummary:
      type: object
      properties:
        operator:
          type: string
          description: >-
            How this group combines with previous groups: AND or OR. Defaults to
            OR. The operator for the first group is ignored.
          enum:
            - AND
            - OR
        blocks:
          type: array
          description: A list of conditions within this group, combined with AND logic.
          items:
            $ref: '#/components/schemas/BlockConditionSummary'
      description: >-
        Represents a group of conditions combined with AND logic. Each group has
        an operator that defines how it combines with the previous groups. Used
        for both blocking and boosting rules to create complex boolean
        expressions.
      title: BlockGroupSummary
    FieldValueSummary:
      required:
        - name
        - value
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      description: A field name and value.
      example:
        name: category
        value: Shirts
      title: FieldValueSummary
    BlockConditionSummary:
      type: object
      properties:
        field:
          type: string
          description: Field to apply the condition to.
        operator:
          type: string
          description: Comparison operator to use.
          enum:
            - EQUAL
            - GREATER_THAN
            - LESS_THAN
            - GREATER_THAN_OR_EQUAL
            - LESS_THAN_OR_EQUAL
            - BETWEEN
            - NOT_EQUAL
        value:
          type: string
          description: Single value for single-valued operators.
        minValue:
          type: string
          description: Min value for `BETWEEN` operator (inclusive).
        maxValue:
          type: string
          description: Max value for `BETWEEN` operator (inclusive).
      description: >-
        Represents a condition with support for different comparison operators.
        Used for blocking, boosting, or filtering based on field values and
        ranges.
      title: BlockConditionSummary
  securitySchemes:
    authToken:
      type: http
      scheme: bearer

````