{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-textract/json-schema/amazon-textract-start-document-analysis-request-schema.json",
  "title": "StartDocumentAnalysisRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-textract-document-analysis-api-openapi.yml#/components/schemas/StartDocumentAnalysisRequest",
  "type": "object",
  "properties": {
    "DocumentLocation": {
      "$ref": "#/$defs/DocumentLocation"
    },
    "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. To perform both types of analysis, add TABLES and FORMS to FeatureTypes. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes)."
    },
    "ClientRequestToken": {
      "type": "string",
      "description": "The idempotent token that you use to identify the start request. If you use the same token with multiple StartDocumentAnalysis requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations."
    },
    "JobTag": {
      "type": "string",
      "description": "An identifier that you specify that's included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt)."
    },
    "NotificationChannel": {
      "$ref": "#/$defs/NotificationChannel"
    },
    "OutputConfig": {
      "$ref": "#/$defs/OutputConfig"
    },
    "KMSKeyId": {
      "type": "string",
      "description": "The KMS key used to encrypt the inference results. This can be in either Key ID or Key Alias format. When a KMS key is provided, the KMS key will be used for server-side encryption of the objects in the customer bucket. When this parameter is not enabled, the result will be encrypted server side,using SSE-S3."
    },
    "QueriesConfig": {
      "$ref": "#/$defs/QueriesConfig"
    },
    "AdaptersConfig": {
      "$ref": "#/$defs/AdaptersConfig"
    }
  },
  "required": [
    "DocumentLocation",
    "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"
      ]
    },
    "DocumentLocation": {
      "type": "object",
      "properties": {
        "S3Object": {
          "$ref": "#/$defs/S3Object"
        }
      }
    },
    "NotificationChannel": {
      "type": "object",
      "properties": {
        "SNSTopicArn": {
          "type": "string",
          "description": "The Amazon SNS topic that Amazon Textract posts the completion status to."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic."
        }
      },
      "required": [
        "SNSTopicArn",
        "RoleArn"
      ]
    },
    "OutputConfig": {
      "type": "object",
      "properties": {
        "S3Bucket": {
          "type": "string",
          "description": "The name of the bucket your output will go to."
        },
        "S3Prefix": {
          "type": "string",
          "description": "The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output\"."
        }
      },
      "required": [
        "S3Bucket"
      ]
    },
    "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."
        }
      }
    }
  }
}