{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-opensearch/json-schema/amazon-opensearch-create-ingestion-stream-request-schema.json",
  "title": "CreateIngestionStreamRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-opensearch-ingestion-stream-api-openapi.yml#/components/schemas/CreateIngestionStreamRequest",
  "type": "object",
  "properties": {
    "collectionId": {
      "type": "string",
      "description": "The unique identifier of the collection to ingest data into."
    },
    "ingestionStreamName": {
      "type": "string",
      "description": "The name of the ingestion stream. The name must be unique within the collection."
    },
    "indexName": {
      "type": "string",
      "description": "The name of the index to ingest documents into."
    },
    "failureIndexName": {
      "type": "string",
      "description": "The name of the index where documents that fail to be ingested are recorded."
    },
    "source": {
      "$ref": "#/$defs/IngestionStreamSource"
    },
    "roleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the IAM role that OpenSearch Serverless assumes to read data from the source. The role must be in the same account as the collection."
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AossTag"
      },
      "description": "An arbitrary set of tags (key–value pairs) to associate with the ingestion stream."
    },
    "clientToken": {
      "type": "string",
      "description": "Unique, case-sensitive identifier to ensure idempotency of the request."
    }
  },
  "required": [
    "collectionId",
    "ingestionStreamName",
    "indexName",
    "source",
    "roleArn"
  ],
  "$defs": {
    "AossTag": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The key to use in the tag."
        },
        "value": {
          "type": "string",
          "description": "The value of the tag."
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "IngestionStreamS3Source": {
      "type": "object",
      "properties": {
        "sqsArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the Amazon SQS queue that receives Amazon S3 event notifications for the source buckets."
        },
        "buckets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StreamBucketConfig"
          },
          "description": "The configuration for each Amazon S3 bucket that the ingestion stream ingests data from."
        }
      },
      "required": [
        "sqsArn"
      ]
    },
    "IngestionStreamSource": {
      "type": "object",
      "properties": {
        "s3": {
          "$ref": "#/$defs/IngestionStreamS3Source"
        }
      },
      "required": [
        "s3"
      ]
    },
    "StreamBucketConfig": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "description": "The name or Amazon Resource Name (ARN) of the Amazon S3 bucket to ingest data from."
        },
        "bucketOwnerAccountId": {
          "type": "string",
          "description": "The AWS account ID that owns the S3 bucket. Optional. If omitted, the control plane derives it from the account segment of sqsArn."
        },
        "initialScan": {
          "type": "string",
          "description": "Specifies whether to perform a one-time scan of the objects that already exist in the bucket before the stream begins processing Amazon S3 event notifications. If DISABLED, only new objects are ingested."
        }
      },
      "required": [
        "bucket"
      ]
    }
  }
}