CreateDetectorVersionCommand

Creates a detector version. The detector version starts in a DRAFT status.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { FraudDetectorClient, CreateDetectorVersionCommand } from "@aws-sdk/client-frauddetector"; // ES Modules import
// const { FraudDetectorClient, CreateDetectorVersionCommand } = require("@aws-sdk/client-frauddetector"); // CommonJS import
const client = new FraudDetectorClient(config);
const input = { // CreateDetectorVersionRequest
  detectorId: "STRING_VALUE", // required
  description: "STRING_VALUE",
  externalModelEndpoints: [ // ListOfStrings
    "STRING_VALUE",
  ],
  rules: [ // RuleList // required
    { // Rule
      detectorId: "STRING_VALUE", // required
      ruleId: "STRING_VALUE", // required
      ruleVersion: "STRING_VALUE", // required
    },
  ],
  modelVersions: [ // ListOfModelVersions
    { // ModelVersion
      modelId: "STRING_VALUE", // required
      modelType: "ONLINE_FRAUD_INSIGHTS" || "TRANSACTION_FRAUD_INSIGHTS" || "ACCOUNT_TAKEOVER_INSIGHTS", // required
      modelVersionNumber: "STRING_VALUE", // required
      arn: "STRING_VALUE",
    },
  ],
  ruleExecutionMode: "ALL_MATCHED" || "FIRST_MATCHED",
  tags: [ // tagList
    { // Tag
      key: "STRING_VALUE", // required
      value: "STRING_VALUE", // required
    },
  ],
};
const command = new CreateDetectorVersionCommand(input);
const response = await client.send(command);
// { // CreateDetectorVersionResult
//   detectorId: "STRING_VALUE",
//   detectorVersionId: "STRING_VALUE",
//   status: "DRAFT" || "ACTIVE" || "INACTIVE",
// };

CreateDetectorVersionCommand Input

Parameter
Type
Description
detectorId
Required
string | undefined

The ID of the detector under which you want to create a new version.

rules
Required
Rule[] | undefined

The rules to include in the detector version.

description
string | undefined

The description of the detector version.

externalModelEndpoints
string[] | undefined

The Amazon Sagemaker model endpoints to include in the detector version.

modelVersions
ModelVersion[] | undefined

The model versions to include in the detector version.

ruleExecutionMode
RuleExecutionMode | undefined

The rule execution mode for the rules included in the detector version.

You can define and edit the rule mode at the detector version level, when it is in draft status.

If you specify FIRST_MATCHED, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule.

If you specifiy ALL_MATCHED, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules.

The default behavior is FIRST_MATCHED.

tags
Tag[] | undefined

A collection of key and value pairs.

CreateDetectorVersionCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
detectorId
string | undefined

The ID for the created version's parent detector.

detectorVersionId
string | undefined

The ID for the created detector.

status
DetectorVersionStatus | undefined

The status of the detector version.

Throws

Name
Fault
Details
AccessDeniedException
client

An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

InternalServerException
server

An exception indicating an internal server error.

ResourceNotFoundException
client

An exception indicating the specified resource was not found.

ThrottlingException
client

An exception indicating a throttling error.

ValidationException
client

An exception indicating a specified value is not allowed.

FraudDetectorServiceException
Base exception class for all service exceptions from FraudDetector service.