{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-kendra/json-schema/amazon-kendra-retrieve-request-schema.json",
  "title": "RetrieveRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-kendra-operations-api-openapi.yml#/components/schemas/RetrieveRequest",
  "type": "object",
  "properties": {
    "IndexId": {
      "type": "string",
      "description": "The identifier of the index to retrieve relevant passages for the search."
    },
    "QueryText": {
      "type": "string",
      "description": "The input query text to retrieve relevant passages for the search. Amazon Kendra truncates queries at 30 token words, which excludes punctuation and stop words. Truncation still applies if you use Boolean or more advanced, complex queries. For example, Timeoff AND October AND Category:HR is counted as 3 tokens: timeoff, october, hr. For more information, see Searching with advanced query syntax in the Amazon Kendra Developer Guide."
    },
    "AttributeFilter": {
      "$ref": "#/$defs/AttributeFilter"
    },
    "RequestedDocumentAttributes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of document fields/attributes to include in the response. You can limit the response to include certain document fields. By default, all document fields are included in the response."
    },
    "DocumentRelevanceOverrideConfigurations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DocumentRelevanceConfiguration"
      },
      "description": "Overrides relevance tuning configurations of fields/attributes set at the index level. If you use this API to override the relevance tuning configured at the index level, but there is no relevance tuning configured at the index level, then Amazon Kendra does not apply any relevance tuning. If there is relevance tuning configured for fields at the index level, and you use this API to override only some of these fields, then for the fields you did not override, the importance is set to 1."
    },
    "PageNumber": {
      "type": "integer",
      "description": "Retrieved relevant passages are returned in pages the size of the PageSize parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one."
    },
    "PageSize": {
      "type": "integer",
      "description": "Sets the number of retrieved relevant passages that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned."
    },
    "UserContext": {
      "$ref": "#/$defs/UserContext"
    }
  },
  "required": [
    "IndexId",
    "QueryText"
  ],
  "$defs": {
    "AttributeFilter": {
      "type": "object",
      "properties": {
        "AndAllFilters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AttributeFilter"
          },
          "description": "Performs a logical AND operation on all filters that you specify."
        },
        "OrAllFilters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AttributeFilter"
          },
          "description": "Performs a logical OR operation on all filters that you specify."
        },
        "NotFilter": {
          "$ref": "#/$defs/AttributeFilter"
        },
        "EqualsTo": {
          "$ref": "#/$defs/DocumentAttribute"
        },
        "ContainsAll": {
          "$ref": "#/$defs/DocumentAttribute"
        },
        "ContainsAny": {
          "$ref": "#/$defs/DocumentAttribute"
        },
        "GreaterThan": {
          "$ref": "#/$defs/DocumentAttribute"
        },
        "GreaterThanOrEquals": {
          "$ref": "#/$defs/DocumentAttribute"
        },
        "LessThan": {
          "$ref": "#/$defs/DocumentAttribute"
        },
        "LessThanOrEquals": {
          "$ref": "#/$defs/DocumentAttribute"
        }
      }
    },
    "DataSourceGroup": {
      "type": "object",
      "properties": {
        "GroupId": {
          "type": "string",
          "description": "The identifier of the group you want to add to your list of groups. This is for filtering search results based on the groups' access to documents."
        },
        "DataSourceId": {
          "type": "string",
          "description": "The identifier of the data source group you want to add to your list of data source groups. This is for filtering search results based on the groups' access to documents in that data source."
        }
      },
      "required": [
        "GroupId",
        "DataSourceId"
      ]
    },
    "DocumentAttribute": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The identifier for the attribute."
        },
        "Value": {
          "$ref": "#/$defs/DocumentAttributeValue"
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "DocumentAttributeValue": {
      "type": "object",
      "properties": {
        "StringValue": {
          "type": "string",
          "description": "A string, such as \"department\"."
        },
        "StringListValue": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of strings. The default maximum length or number of strings is 10."
        },
        "LongValue": {
          "type": "integer",
          "description": "A long integer value."
        },
        "DateValue": {
          "type": "string",
          "format": "date-time",
          "description": "A date expressed as an ISO 8601 string. It is important for the time zone to be included in the ISO 8601 date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time."
        }
      }
    },
    "DocumentRelevanceConfiguration": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the index field."
        },
        "Relevance": {
          "$ref": "#/$defs/Relevance"
        }
      },
      "required": [
        "Name",
        "Relevance"
      ]
    },
    "Relevance": {
      "type": "object",
      "properties": {
        "Freshness": {
          "type": "boolean",
          "description": "Indicates that this field determines how \"fresh\" a document is. For example, if document 1 was created on November 5, and document 2 was created on October 31, document 1 is \"fresher\" than document 2. Only applies to DATE fields."
        },
        "Importance": {
          "type": "integer",
          "description": "The relative importance of the field in the search. Larger numbers provide more of a boost than smaller numbers."
        },
        "Duration": {
          "type": "string",
          "description": "Specifies the time period that the boost applies to. For example, to make the boost apply to documents with the field value within the last month, you would use \"2628000s\". Once the field value is beyond the specified range, the effect of the boost drops off. The higher the importance, the faster the effect drops off. If you don't specify a value, the default is 3 months. The value of the field is a numeric string followed by the character \"s\", for example \"86400s\" for one day, or \"604800s\" for one week. Only applies to DATE fields."
        },
        "RankOrder": {
          "type": "string",
          "enum": [
            "ASCENDING",
            "DESCENDING"
          ],
          "description": "Determines how values should be interpreted. When the RankOrder field is ASCENDING, higher numbers are better. For example, a document with a rating score of 10 is higher ranking than a document with a rating score of 1. When the RankOrder field is DESCENDING, lower numbers are better. For example, in a task tracking application, a priority 1 task is more important than a priority 5 task. Only applies to LONG fields."
        },
        "ValueImportanceMap": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          },
          "description": "A list of values that should be given a different boost when they appear in the result list. For example, if you are boosting a field called \"department\", query terms that match the department field are boosted in the result. However, you can add entries from the department field to boost documents with those values higher. For example, you can add entries to the map with names of departments. If you add \"HR\",5 and \"Legal\",3 those departments are given special attention when they appear in the metadata of a document. When those terms appear they are given the specified importance instead of th"
        }
      }
    },
    "UserContext": {
      "type": "object",
      "properties": {
        "Token": {
          "type": "string",
          "description": "The user context token for filtering search results for a user. It must be a JWT or a JSON token."
        },
        "UserId": {
          "type": "string",
          "description": "The identifier of the user you want to filter search results based on their access to documents."
        },
        "Groups": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of groups you want to filter search results based on the groups' access to documents."
        },
        "DataSourceGroups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DataSourceGroup"
          },
          "description": "The list of data source groups you want to filter search results based on groups' access to documents in that data source."
        }
      }
    }
  }
}