{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-fraud-detector/json-schema/amazon-fraud-detector-create-model-version-request-schema.json",
  "title": "CreateModelVersionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-fraud-detector-model-version-api-openapi.yml#/components/schemas/CreateModelVersionRequest",
  "type": "object",
  "properties": {
    "modelId": {
      "type": "string",
      "description": "The model ID."
    },
    "modelType": {
      "type": "string",
      "enum": [
        "ONLINE_FRAUD_INSIGHTS",
        "TRANSACTION_FRAUD_INSIGHTS",
        "ACCOUNT_TAKEOVER_INSIGHTS"
      ],
      "description": "The model type."
    },
    "trainingDataSource": {
      "type": "string",
      "enum": [
        "EXTERNAL_EVENTS",
        "INGESTED_EVENTS"
      ],
      "description": "The training data source location in Amazon S3."
    },
    "trainingDataSchema": {
      "$ref": "#/$defs/TrainingDataSchema"
    },
    "externalEventsDetail": {
      "$ref": "#/$defs/ExternalEventsDetail"
    },
    "ingestedEventsDetail": {
      "$ref": "#/$defs/IngestedEventsDetail"
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "A collection of key and value pairs."
    }
  },
  "required": [
    "modelId",
    "modelType",
    "trainingDataSource",
    "trainingDataSchema"
  ],
  "$defs": {
    "ExternalEventsDetail": {
      "type": "object",
      "properties": {
        "dataLocation": {
          "type": "string",
          "description": "The Amazon S3 bucket location for the data."
        },
        "dataAccessRoleArn": {
          "type": "string",
          "description": "The ARN of the role that provides Amazon Fraud Detector access to the data location."
        }
      },
      "required": [
        "dataLocation",
        "dataAccessRoleArn"
      ]
    },
    "IngestedEventsDetail": {
      "type": "object",
      "properties": {
        "ingestedEventsTimeWindow": {
          "$ref": "#/$defs/IngestedEventsTimeWindow"
        }
      },
      "required": [
        "ingestedEventsTimeWindow"
      ]
    },
    "IngestedEventsTimeWindow": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "description": "Timestamp of the first ingensted event."
        },
        "endTime": {
          "type": "string",
          "description": "Timestamp of the final ingested event."
        }
      },
      "required": [
        "startTime",
        "endTime"
      ]
    },
    "LabelSchema": {
      "type": "object",
      "properties": {
        "labelMapper": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "The label mapper maps the Amazon Fraud Detector supported model classification labels (FRAUD, LEGIT) to the appropriate event type labels. For example, if \"FRAUD\" and \"LEGIT\" are Amazon Fraud Detector supported labels, this mapper could be: {\"FRAUD\" => [\"0\"], \"LEGIT\" => [\"1\"]} or {\"FRAUD\" => [\"false\"], \"LEGIT\" => [\"true\"]} or {\"FRAUD\" => [\"fraud\", \"abuse\"], \"LEGIT\" => [\"legit\", \"safe\"]}. The value part of the mapper is a list, because you may have multiple label variants from your event type for a single Amazon Fraud Detector label."
        },
        "unlabeledEventsTreatment": {
          "type": "string",
          "enum": [
            "IGNORE",
            "FRAUD",
            "LEGIT",
            "AUTO"
          ],
          "description": "The action to take for unlabeled events. Use IGNORE if you want the unlabeled events to be ignored. This is recommended when the majority of the events in the dataset are labeled. Use FRAUD if you want to categorize all unlabeled events as “Fraud”. This is recommended when most of the events in your dataset are fraudulent. Use LEGIT if you want to categorize all unlabeled events as “Legit”. This is recommended when most of the events in your dataset are legitimate. Use AUTO if you want Amazon Fraud Detector to decide how to use the unlabeled data. This is recommended when there is significant "
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "A tag key."
        },
        "value": {
          "type": "string",
          "description": "A value assigned to a tag key."
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "TrainingDataSchema": {
      "type": "object",
      "properties": {
        "modelVariables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The training data schema variables."
        },
        "labelSchema": {
          "$ref": "#/$defs/LabelSchema"
        }
      },
      "required": [
        "modelVariables"
      ]
    }
  }
}