{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-q/json-schema/amazon-q-batch-put-document-request-schema.json",
  "title": "BatchPutDocumentRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-q-documents-api-openapi.yml#/components/schemas/BatchPutDocumentRequest",
  "type": "object",
  "properties": {
    "applicationId": {
      "type": "string",
      "description": "The identifier of the Amazon Q Business application."
    },
    "indexId": {
      "type": "string",
      "description": "The identifier of the Amazon Q Business index to add the documents to."
    },
    "documents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Document"
      },
      "description": "One or more documents to add to the index. Ensure that the name of your document doesn't contain any confidential information. Amazon Q Business returns document names in chat responses and citations when relevant."
    },
    "roleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket."
    },
    "dataSourceSyncId": {
      "type": "string",
      "description": "The identifier of the data source sync during which the documents were added."
    }
  },
  "required": [
    "applicationId",
    "indexId",
    "documents"
  ],
  "$defs": {
    "AccessConfiguration": {
      "type": "object",
      "properties": {
        "accessControls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccessControl"
          },
          "description": "A list of AccessControlList objects."
        },
        "memberRelation": {
          "type": "string",
          "enum": [
            "AND",
            "OR"
          ],
          "description": "Describes the member relation within the AccessControlList object."
        }
      },
      "required": [
        "accessControls"
      ]
    },
    "AccessControl": {
      "type": "object",
      "properties": {
        "principals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Principal"
          },
          "description": "Contains a list of principals, where a principal can be either a USER or a GROUP. Each principal can be have the following type of document access: ALLOW or DENY."
        },
        "memberRelation": {
          "type": "string",
          "enum": [
            "AND",
            "OR"
          ],
          "description": "Describes the member relation within a principal list."
        }
      },
      "required": [
        "principals"
      ]
    },
    "AudioExtractionConfiguration": {
      "type": "object",
      "properties": {
        "audioExtractionStatus": {
          "type": "string",
          "enum": [
            "ENABLED",
            "DISABLED"
          ],
          "description": "The status of audio extraction (ENABLED or DISABLED) for processing audio content from files."
        }
      },
      "required": [
        "audioExtractionStatus"
      ]
    },
    "Document": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the document."
        },
        "attributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DocumentAttribute"
          },
          "description": "Custom attributes to apply to the document for refining Amazon Q Business web experience responses."
        },
        "content": {
          "$ref": "#/$defs/DocumentContent"
        },
        "contentType": {
          "type": "string",
          "enum": [
            "PDF",
            "HTML",
            "MS_WORD",
            "PLAIN_TEXT",
            "PPT",
            "RTF",
            "XML",
            "XSLT",
            "MS_EXCEL",
            "CSV",
            "JSON",
            "MD"
          ],
          "description": "The file type of the document in the Blob field. If you want to index snippets or subsets of HTML documents instead of the entirety of the HTML documents, you add the HTML start and closing tags (&lt;HTML&gt;content&lt;/HTML&gt;) around the content."
        },
        "title": {
          "type": "string",
          "description": "The title of the document."
        },
        "accessConfiguration": {
          "$ref": "#/$defs/AccessConfiguration"
        },
        "documentEnrichmentConfiguration": {
          "$ref": "#/$defs/DocumentEnrichmentConfiguration"
        },
        "mediaExtractionConfiguration": {
          "$ref": "#/$defs/MediaExtractionConfiguration"
        }
      },
      "required": [
        "id"
      ]
    },
    "DocumentAttribute": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The identifier for the attribute."
        },
        "value": {
          "$ref": "#/$defs/DocumentAttributeValue"
        }
      },
      "required": [
        "name",
        "value"
      ]
    },
    "DocumentAttributeCondition": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The identifier of the document attribute used for the condition. For example, 'Source_URI' could be an identifier for the attribute or metadata field that contains source URIs associated with the documents. Amazon Q Business currently doesn't support _document_body as an attribute key used for the condition."
        },
        "operator": {
          "type": "string",
          "enum": [
            "GREATER_THAN",
            "GREATER_THAN_OR_EQUALS",
            "LESS_THAN",
            "LESS_THAN_OR_EQUALS",
            "EQUALS",
            "NOT_EQUALS",
            "CONTAINS",
            "NOT_CONTAINS",
            "EXISTS",
            "NOT_EXISTS",
            "BEGINS_WITH"
          ],
          "description": "The identifier of the document attribute used for the condition. For example, 'Source_URI' could be an identifier for the attribute or metadata field that contains source URIs associated with the documents. Amazon Q Business currently does not support _document_body as an attribute key used for the condition."
        },
        "value": {
          "$ref": "#/$defs/DocumentAttributeValue"
        }
      },
      "required": [
        "key",
        "operator"
      ]
    },
    "DocumentAttributeTarget": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The identifier of the target document attribute or metadata field. For example, 'Department' could be an identifier for the target attribute or metadata field that includes the department names associated with the documents."
        },
        "value": {
          "$ref": "#/$defs/DocumentAttributeValue"
        },
        "attributeValueOperator": {
          "type": "string",
          "enum": [
            "DELETE"
          ],
          "description": "TRUE to delete the existing target value for your specified target attribute key. You cannot create a target value and set this to TRUE."
        }
      },
      "required": [
        "key"
      ]
    },
    "DocumentAttributeValue": {
      "type": "object",
      "properties": {
        "stringValue": {
          "type": "string",
          "description": "A string."
        },
        "stringListValue": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of strings."
        },
        "longValue": {
          "type": "integer",
          "description": "A long integer value."
        },
        "dateValue": {
          "type": "string",
          "format": "date-time",
          "description": "A date expressed as an ISO 8601 string. It's 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."
        }
      },
      "description": "Exactly one member is set."
    },
    "DocumentContent": {
      "type": "object",
      "properties": {
        "blob": {
          "type": "string",
          "description": "The contents of the document. Documents passed to the blob parameter must be base64 encoded. Your code might not need to encode the document file bytes if you're using an Amazon Web Services SDK to call Amazon Q Business APIs. If you are calling the Amazon Q Business endpoint directly using REST, you must base64 encode the contents before sending."
        },
        "s3": {
          "$ref": "#/$defs/S3"
        }
      },
      "description": "Exactly one member is set."
    },
    "DocumentEnrichmentConfiguration": {
      "type": "object",
      "properties": {
        "inlineConfigurations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InlineDocumentEnrichmentConfiguration"
          },
          "description": "Configuration information to alter document attributes or metadata fields and content when ingesting documents into Amazon Q Business."
        },
        "preExtractionHookConfiguration": {
          "$ref": "#/$defs/HookConfiguration"
        },
        "postExtractionHookConfiguration": {
          "$ref": "#/$defs/HookConfiguration"
        }
      }
    },
    "HookConfiguration": {
      "type": "object",
      "properties": {
        "invocationCondition": {
          "$ref": "#/$defs/DocumentAttributeCondition"
        },
        "lambdaArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the Lambda function during ingestion. For more information, see Using Lambda functions for Amazon Q Business document enrichment."
        },
        "s3BucketName": {
          "type": "string",
          "description": "Stores the original, raw documents or the structured, parsed documents before and after altering them. For more information, see Data contracts for Lambda functions."
        },
        "roleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of a role with permission to run PreExtractionHookConfiguration and PostExtractionHookConfiguration for altering document metadata and content during the document ingestion process."
        }
      }
    },
    "ImageExtractionConfiguration": {
      "type": "object",
      "properties": {
        "imageExtractionStatus": {
          "type": "string",
          "enum": [
            "ENABLED",
            "DISABLED"
          ],
          "description": "Specify whether to extract semantic meaning from images and visuals from documents."
        }
      },
      "required": [
        "imageExtractionStatus"
      ]
    },
    "InlineDocumentEnrichmentConfiguration": {
      "type": "object",
      "properties": {
        "condition": {
          "$ref": "#/$defs/DocumentAttributeCondition"
        },
        "target": {
          "$ref": "#/$defs/DocumentAttributeTarget"
        },
        "documentContentOperator": {
          "type": "string",
          "enum": [
            "DELETE"
          ],
          "description": "TRUE to delete content if the condition used for the target attribute is met."
        }
      }
    },
    "MediaExtractionConfiguration": {
      "type": "object",
      "properties": {
        "imageExtractionConfiguration": {
          "$ref": "#/$defs/ImageExtractionConfiguration"
        },
        "audioExtractionConfiguration": {
          "$ref": "#/$defs/AudioExtractionConfiguration"
        },
        "videoExtractionConfiguration": {
          "$ref": "#/$defs/VideoExtractionConfiguration"
        }
      }
    },
    "Principal": {
      "type": "object",
      "properties": {
        "user": {
          "$ref": "#/$defs/PrincipalUser"
        },
        "group": {
          "$ref": "#/$defs/PrincipalGroup"
        }
      },
      "description": "Exactly one member is set."
    },
    "PrincipalGroup": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the group."
        },
        "access": {
          "type": "string",
          "enum": [
            "ALLOW",
            "DENY"
          ],
          "description": "Provides information about whether to allow or deny access to the principal."
        },
        "membershipType": {
          "type": "string",
          "enum": [
            "INDEX",
            "DATASOURCE"
          ],
          "description": "The type of group."
        }
      },
      "required": [
        "access"
      ]
    },
    "PrincipalUser": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The identifier of the user."
        },
        "access": {
          "type": "string",
          "enum": [
            "ALLOW",
            "DENY"
          ],
          "description": "Provides information about whether to allow or deny access to the principal."
        },
        "membershipType": {
          "type": "string",
          "enum": [
            "INDEX",
            "DATASOURCE"
          ],
          "description": "The type of group."
        }
      },
      "required": [
        "access"
      ]
    },
    "S3": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "description": "The name of the S3 bucket that contains the file."
        },
        "key": {
          "type": "string",
          "description": "The name of the file."
        }
      },
      "required": [
        "bucket",
        "key"
      ]
    },
    "VideoExtractionConfiguration": {
      "type": "object",
      "properties": {
        "videoExtractionStatus": {
          "type": "string",
          "enum": [
            "ENABLED",
            "DISABLED"
          ],
          "description": "The status of video extraction (ENABLED or DISABLED) for processing video content from files."
        }
      },
      "required": [
        "videoExtractionStatus"
      ]
    }
  }
}