{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-textract/json-schema/amazon-textract-analyze-document-request-schema.json",
  "title": "AnalyzeDocumentRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-textract-async-operations-api-openapi.yml#/components/schemas/AnalyzeDocumentRequest",
  "type": "object",
  "properties": {
    "Document": {
      "$ref": "#/$defs/Document"
    },
    "FeatureTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "TABLES",
          "FORMS",
          "QUERIES",
          "SIGNATURES",
          "LAYOUT"
        ]
      },
      "description": "A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes)."
    },
    "HumanLoopConfig": {
      "$ref": "#/$defs/HumanLoopConfig"
    },
    "QueriesConfig": {
      "$ref": "#/$defs/QueriesConfig"
    },
    "AdaptersConfig": {
      "$ref": "#/$defs/AdaptersConfig"
    }
  },
  "required": [
    "Document",
    "FeatureTypes"
  ],
  "$defs": {
    "Adapter": {
      "type": "object",
      "properties": {
        "AdapterId": {
          "type": "string",
          "description": "A unique identifier for the adapter resource."
        },
        "Pages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a list of rules for using this parameter. If a page is not specified, it is set to [\"1\"] by default. The following characters are allowed in the parameter's string: 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. When using * to indicate all pages, it must be the only element in the list. You can use page intervals, such as [\"1-3\", \"1-1\", \"4-*\"]. Where * indicates last page of document. Specified pages must be greater than 0 and less than or equal to the number of pages in the document."
        },
        "Version": {
          "type": "string",
          "description": "A string that identifies the version of the adapter."
        }
      },
      "required": [
        "AdapterId",
        "Version"
      ]
    },
    "AdaptersConfig": {
      "type": "object",
      "properties": {
        "Adapters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Adapter"
          },
          "description": "A list of adapters to be used when analyzing the specified document."
        }
      },
      "required": [
        "Adapters"
      ]
    },
    "Document": {
      "type": "object",
      "properties": {
        "Bytes": {
          "type": "string",
          "format": "byte",
          "description": "A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format. If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field."
        },
        "S3Object": {
          "$ref": "#/$defs/S3Object"
        }
      }
    },
    "HumanLoopConfig": {
      "type": "object",
      "properties": {
        "HumanLoopName": {
          "type": "string",
          "description": "The name of the human workflow used for this image. This should be kept unique within a region."
        },
        "FlowDefinitionArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the flow definition."
        },
        "DataAttributes": {
          "$ref": "#/$defs/HumanLoopDataAttributes"
        }
      },
      "required": [
        "HumanLoopName",
        "FlowDefinitionArn"
      ]
    },
    "HumanLoopDataAttributes": {
      "type": "object",
      "properties": {
        "ContentClassifiers": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "FreeOfPersonallyIdentifiableInformation",
              "FreeOfAdultContent"
            ]
          },
          "description": "Sets whether the input image is free of personally identifiable information or adult content."
        }
      }
    },
    "QueriesConfig": {
      "type": "object",
      "properties": {
        "Queries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        }
      },
      "required": [
        "Queries"
      ]
    },
    "Query": {
      "type": "object",
      "properties": {
        "Text": {
          "type": "string",
          "description": "Question that Amazon Textract will apply to the document. An example would be \"What is the customer's SSN?\""
        },
        "Alias": {
          "type": "string",
          "description": "Alias attached to the query, for ease of location."
        },
        "Pages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pages is a parameter that the user inputs to specify which pages to apply a query to. The following is a list of rules for using this parameter. If a page is not specified, it is set to [\"1\"] by default. The following characters are allowed in the parameter's string: 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. When using * to indicate all pages, it must be the only element in the list. You can use page intervals, such as [“1-3”, “1-1”, “4-*”]. Where * indicates last page of document. Specified pages must be greater than 0 and less than or equal to the number of pages in the document."
        }
      },
      "required": [
        "Text"
      ]
    },
    "S3Object": {
      "type": "object",
      "properties": {
        "Bucket": {
          "type": "string",
          "description": "The name of the S3 bucket. Note that the # character is not valid in the file name."
        },
        "Name": {
          "type": "string",
          "description": "The file name of the input document. Image files may be in PDF, TIFF, JPEG, or PNG format."
        },
        "Version": {
          "type": "string",
          "description": "If the bucket has versioning enabled, you can specify the object version."
        }
      }
    }
  }
}