{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elastic/json-schema/elastic-global-reindex-destination-schema.json",
  "title": "_global.reindex.Destination",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elastic-document-api-openapi.yml#/components/schemas/_global.reindex.Destination",
  "type": "object",
  "properties": {
    "index": {
      "description": "The name of the data stream, index, or index alias you are copying to.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.IndexName"
        }
      ]
    },
    "op_type": {
      "description": "If it is `create`, the operation will only index documents that do not already exist (also known as \"put if absent\").\n\nIMPORTANT: To reindex to a data stream destination, this argument must be `create`.\n\nSupported values include:\n  - `index`: Overwrite any documents that already exist.\n  - `create`: Only index documents that do not already exist.\n\n",
      "default": "index",
      "allOf": [
        {
          "$ref": "#/$defs/_types.OpType"
        }
      ]
    },
    "pipeline": {
      "description": "The name of the pipeline to use.",
      "type": "string"
    },
    "routing": {
      "description": "By default, a document's routing is preserved unless it's changed by the script.\nIf it is `keep`, the routing on the bulk request sent for each match is set to the routing on the match.\nIf it is `discard`, the routing on the bulk request sent for each match is set to `null`.\nIf it is `=value`, the routing on the bulk request sent for each match is set to all value specified after the equals sign (`=`).",
      "default": "keep",
      "allOf": [
        {
          "$ref": "#/$defs/_types.Routing"
        }
      ]
    },
    "version_type": {
      "description": "The versioning to use for the indexing operation.\n\nSupported values include:\n  - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n  - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n  - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n",
      "allOf": [
        {
          "$ref": "#/$defs/_types.VersionType"
        }
      ]
    }
  },
  "required": [
    "index"
  ],
  "$defs": {
    "_types.IndexName": {
      "type": "string"
    },
    "_types.OpType": {
      "type": "string",
      "enum": [
        "index",
        "create"
      ]
    },
    "_types.Routing": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "_types.VersionType": {
      "type": "string",
      "enum": [
        "internal",
        "external",
        "external_gte"
      ]
    }
  }
}