Table of Contents
A low-level client representing Amazon Fraud Detector
This is the Amazon Fraud Detector API Reference. This guide is for developers who need detailed information about Amazon Fraud Detector API actions, data types, and errors. For more information about Amazon Fraud Detector features, see the Amazon Fraud Detector User Guide .
import boto3
client = boto3.client('frauddetector')
These are the available methods:
Creates a batch of variables.
See also: AWS API Documentation
Request Syntax
response = client.batch_create_variable(
variableEntries=[
{
'name': 'string',
'dataType': 'string',
'dataSource': 'string',
'defaultValue': 'string',
'description': 'string',
'variableType': 'string'
},
],
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The list of variables for the batch create variable request.
A variable in the list of variables for the batch create variable request.
The name of the variable.
The data type of the variable.
The data source of the variable.
The default value of the variable.
The description of the variable.
The type of the variable. For more information see Variable types .
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{
'errors': [
{
'name': 'string',
'code': 123,
'message': 'string'
},
]
}
Response Structure
(dict) --
errors (list) --
Provides the errors for the BatchCreateVariable request.
(dict) --
Provides the error of the batch create variable API.
name (string) --
The name.
code (integer) --
The error code.
message (string) --
The error message.
Exceptions
Gets a batch of variables.
See also: AWS API Documentation
Request Syntax
response = client.batch_get_variable(
names=[
'string',
]
)
[REQUIRED]
The list of variable names to get.
{
'variables': [
{
'name': 'string',
'dataType': 'STRING'|'INTEGER'|'FLOAT'|'BOOLEAN',
'dataSource': 'EVENT'|'MODEL_SCORE'|'EXTERNAL_MODEL_SCORE',
'defaultValue': 'string',
'description': 'string',
'variableType': 'string',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'errors': [
{
'name': 'string',
'code': 123,
'message': 'string'
},
]
}
Response Structure
The returned variables.
The variable.
The name of the variable.
The data type of the variable. For more information see Variable types .
The data source of the variable.
The default value of the variable.
The description of the variable.
The variable type of the variable.
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT
The time when variable was last updated.
The time when the variable was created.
The ARN of the variable.
The errors from the request.
Provides the error of the batch get variable API.
The error name.
The error code.
The error message.
Exceptions
Check if an operation can be paginated.
Cancels the specified batch prediction job.
See also: AWS API Documentation
Request Syntax
response = client.cancel_batch_prediction_job(
jobId='string'
)
[REQUIRED]
The ID of the batch prediction job to cancel.
{}
Response Structure
Exceptions
Creates a batch prediction job.
See also: AWS API Documentation
Request Syntax
response = client.create_batch_prediction_job(
jobId='string',
inputPath='string',
outputPath='string',
eventTypeName='string',
detectorName='string',
detectorVersion='string',
iamRoleArn='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The ID of the batch prediction job.
[REQUIRED]
The Amazon S3 location of your training file.
[REQUIRED]
The Amazon S3 location of your output file.
[REQUIRED]
The name of the event type.
[REQUIRED]
The name of the detector.
[REQUIRED]
The ARN of the IAM role to use for this job request.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Creates a detector version. The detector version starts in a DRAFT status.
See also: AWS API Documentation
Request Syntax
response = client.create_detector_version(
detectorId='string',
description='string',
externalModelEndpoints=[
'string',
],
rules=[
{
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
},
],
modelVersions=[
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'arn': 'string'
},
],
ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The ID of the detector under which you want to create a new version.
The Amazon Sagemaker model endpoints to include in the detector version.
[REQUIRED]
The rules to include in the detector version.
A rule.
The detector for which the rule is associated.
The rule ID.
The rule version.
The model versions to include in the detector version.
The model version.
The model ID.
The model type.
The model version number.
The model version ARN.
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 .
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{
'detectorId': 'string',
'detectorVersionId': 'string',
'status': 'DRAFT'|'ACTIVE'|'INACTIVE'
}
Response Structure
(dict) --
detectorId (string) --
The ID for the created version's parent detector.
detectorVersionId (string) --
The ID for the created detector.
status (string) --
The status of the detector version.
Exceptions
Creates a model using the specified model type.
See also: AWS API Documentation
Request Syntax
response = client.create_model(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
description='string',
eventTypeName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The model ID.
[REQUIRED]
The model type.
[REQUIRED]
The name of the event type.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Creates a version of the model using the specified model type and model id.
See also: AWS API Documentation
Request Syntax
response = client.create_model_version(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
trainingDataSource='EXTERNAL_EVENTS',
trainingDataSchema={
'modelVariables': [
'string',
],
'labelSchema': {
'labelMapper': {
'string': [
'string',
]
}
}
},
externalEventsDetail={
'dataLocation': 'string',
'dataAccessRoleArn': 'string'
},
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The model ID.
[REQUIRED]
The model type.
[REQUIRED]
The training data source location in Amazon S3.
[REQUIRED]
The training data schema.
The training data schema variables.
The label schema.
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.
Details for the external events data used for model version training. Required if trainingDataSource is EXTERNAL_EVENTS .
The Amazon S3 bucket location for the data.
The ARN of the role that provides Amazon Fraud Detector access to the data location.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'status': 'string'
}
Response Structure
(dict) --
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number of the model version created.
status (string) --
The model version status.
Exceptions
Creates a rule for use with the specified detector.
See also: AWS API Documentation
Request Syntax
response = client.create_rule(
ruleId='string',
detectorId='string',
description='string',
expression='string',
language='DETECTORPL',
outcomes=[
'string',
],
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The rule ID.
[REQUIRED]
The detector ID for the rule's parent detector.
[REQUIRED]
The rule expression.
[REQUIRED]
The language of the rule.
[REQUIRED]
The outcome or outcomes returned when the rule expression matches.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{
'rule': {
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
}
}
Response Structure
(dict) --
rule (dict) --
The created rule.
detectorId (string) --
The detector for which the rule is associated.
ruleId (string) --
The rule ID.
ruleVersion (string) --
The rule version.
Exceptions
Creates a variable.
See also: AWS API Documentation
Request Syntax
response = client.create_variable(
name='string',
dataType='STRING'|'INTEGER'|'FLOAT'|'BOOLEAN',
dataSource='EVENT'|'MODEL_SCORE'|'EXTERNAL_MODEL_SCORE',
defaultValue='string',
description='string',
variableType='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name of the variable.
[REQUIRED]
The data type.
[REQUIRED]
The source of the data.
[REQUIRED]
The default value for the variable when no value is received.
The variable type. For more information see Variable types .
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Deletes a batch prediction job.
See also: AWS API Documentation
Request Syntax
response = client.delete_batch_prediction_job(
jobId='string'
)
[REQUIRED]
The ID of the batch prediction job to delete.
{}
Response Structure
Exceptions
Deletes the detector. Before deleting a detector, you must first delete all detector versions and rule versions associated with the detector.
When you delete a detector, Amazon Fraud Detector permanently deletes the detector and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_detector(
detectorId='string'
)
[REQUIRED]
The ID of the detector to delete.
{}
Response Structure
Exceptions
Deletes the detector version. You cannot delete detector versions that are in ACTIVE status.
When you delete a detector version, Amazon Fraud Detector permanently deletes the detector and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_detector_version(
detectorId='string',
detectorVersionId='string'
)
[REQUIRED]
The ID of the parent detector for the detector version to delete.
[REQUIRED]
The ID of the detector version to delete.
dict
Response Syntax
{}
Response Structure
Exceptions
Deletes an entity type.
You cannot delete an entity type that is included in an event type.
When you delete an entity type, Amazon Fraud Detector permanently deletes that entity type and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_entity_type(
name='string'
)
[REQUIRED]
The name of the entity type to delete.
{}
Response Structure
Exceptions
Deletes the specified event.
When you delete an event, Amazon Fraud Detector permanently deletes that event and the event data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_event(
eventId='string',
eventTypeName='string'
)
[REQUIRED]
The ID of the event to delete.
[REQUIRED]
The name of the event type.
dict
Response Syntax
{}
Response Structure
Exceptions
Deletes an event type.
You cannot delete an event type that is used in a detector or a model.
When you delete an entity type, Amazon Fraud Detector permanently deletes that entity type and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_event_type(
name='string'
)
[REQUIRED]
The name of the event type to delete.
{}
Response Structure
Exceptions
Removes a SageMaker model from Amazon Fraud Detector.
You can remove an Amazon SageMaker model if it is not associated with a detector version. Removing a SageMaker model disconnects it from Amazon Fraud Detector, but the model remains available in SageMaker.
See also: AWS API Documentation
Request Syntax
response = client.delete_external_model(
modelEndpoint='string'
)
[REQUIRED]
The endpoint of the Amazon Sagemaker model to delete.
{}
Response Structure
Exceptions
Deletes a label.
You cannot delete labels that are included in an event type in Amazon Fraud Detector.
You cannot delete a label assigned to an event ID. You must first delete the relevant event ID.
When you delete a label, Amazon Fraud Detector permanently deletes that label and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_label(
name='string'
)
[REQUIRED]
The name of the label to delete.
{}
Response Structure
Exceptions
Deletes a model.
You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version.
When you delete a model, Amazon Fraud Detector permanently deletes that model and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_model(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS'
)
[REQUIRED]
The model ID of the model to delete.
[REQUIRED]
The model type of the model to delete.
dict
Response Syntax
{}
Response Structure
Exceptions
Deletes a model version.
You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version.
When you delete a model version, Amazon Fraud Detector permanently deletes that model version and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_model_version(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
modelVersionNumber='string'
)
[REQUIRED]
The model ID of the model version to delete.
[REQUIRED]
The model type of the model version to delete.
[REQUIRED]
The model version number of the model version to delete.
dict
Response Syntax
{}
Response Structure
Exceptions
Deletes an outcome.
You cannot delete an outcome that is used in a rule version.
When you delete an outcome, Amazon Fraud Detector permanently deletes that outcome and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_outcome(
name='string'
)
[REQUIRED]
The name of the outcome to delete.
{}
Response Structure
Exceptions
Deletes the rule. You cannot delete a rule if it is used by an ACTIVE or INACTIVE detector version.
When you delete a rule, Amazon Fraud Detector permanently deletes that rule and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_rule(
rule={
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
}
)
[REQUIRED]
A rule.
The detector for which the rule is associated.
The rule ID.
The rule version.
{}
Response Structure
Exceptions
Deletes a variable.
You can't delete variables that are included in an event type in Amazon Fraud Detector.
Amazon Fraud Detector automatically deletes model output variables and SageMaker model output variables when you delete the model. You can't delete these variables manually.
When you delete a variable, Amazon Fraud Detector permanently deletes that variable and the data is no longer stored in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.delete_variable(
name='string'
)
[REQUIRED]
The name of the variable to delete.
{}
Response Structure
Exceptions
Gets all versions for a specified detector.
See also: AWS API Documentation
Request Syntax
response = client.describe_detector(
detectorId='string',
nextToken='string',
maxResults=123
)
[REQUIRED]
The detector ID.
dict
Response Syntax
{
'detectorId': 'string',
'detectorVersionSummaries': [
{
'detectorVersionId': 'string',
'status': 'DRAFT'|'ACTIVE'|'INACTIVE',
'description': 'string',
'lastUpdatedTime': 'string'
},
],
'nextToken': 'string',
'arn': 'string'
}
Response Structure
(dict) --
detectorId (string) --
The detector ID.
detectorVersionSummaries (list) --
The status and description for each detector version.
(dict) --
The summary of the detector version.
detectorVersionId (string) --
The detector version ID.
status (string) --
The detector version status.
description (string) --
The detector version description.
lastUpdatedTime (string) --
Timestamp of when the detector version was last updated.
nextToken (string) --
The next token to be used for subsequent requests.
arn (string) --
The detector ARN.
Exceptions
Gets all of the model versions for the specified model type or for the specified model type and model ID. You can also get details for a single, specified model version.
See also: AWS API Documentation
Request Syntax
response = client.describe_model_versions(
modelId='string',
modelVersionNumber='string',
modelType='ONLINE_FRAUD_INSIGHTS',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'modelVersionDetails': [
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'status': 'string',
'trainingDataSource': 'EXTERNAL_EVENTS',
'trainingDataSchema': {
'modelVariables': [
'string',
],
'labelSchema': {
'labelMapper': {
'string': [
'string',
]
}
}
},
'externalEventsDetail': {
'dataLocation': 'string',
'dataAccessRoleArn': 'string'
},
'trainingResult': {
'dataValidationMetrics': {
'fileLevelMessages': [
{
'title': 'string',
'content': 'string',
'type': 'string'
},
],
'fieldLevelMessages': [
{
'fieldName': 'string',
'identifier': 'string',
'title': 'string',
'content': 'string',
'type': 'string'
},
]
},
'trainingMetrics': {
'auc': ...,
'metricDataPoints': [
{
'fpr': ...,
'precision': ...,
'tpr': ...,
'threshold': ...
},
]
},
'variableImportanceMetrics': {
'LogitMetrics': [
{
'variableName': 'string',
'variableType': 'string',
'variableImportance': ...
},
]
}
},
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
modelVersionDetails (list) --
The model version details.
(dict) --
The details of the model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
status (string) --
The status of the model version.
trainingDataSource (string) --
The model version training data source.
trainingDataSchema (dict) --
The training data schema.
modelVariables (list) --
The training data schema variables.
labelSchema (dict) --
The label schema.
labelMapper (dict) --
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.
externalEventsDetail (dict) --
The event details.
dataLocation (string) --
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) --
The ARN of the role that provides Amazon Fraud Detector access to the data location.
trainingResult (dict) --
The training results.
dataValidationMetrics (dict) --
The validation metrics.
fileLevelMessages (list) --
The file-specific model training validation messages.
(dict) --
The message details.
title (string) --
The message title.
content (string) --
The message content.
type (string) --
The message type.
fieldLevelMessages (list) --
The field-specific model training validation messages.
(dict) --
The message details.
fieldName (string) --
The field name.
identifier (string) --
The message ID.
title (string) --
The message title.
content (string) --
The message content.
type (string) --
The message type.
trainingMetrics (dict) --
The training metric details.
auc (float) --
The area under the curve. This summarizes true positive rate (TPR) and false positive rate (FPR) across all possible model score thresholds. A model with no predictive power has an AUC of 0.5, whereas a perfect model has a score of 1.0.
metricDataPoints (list) --
The data points details.
(dict) --
Model performance metrics data points.
fpr (float) --
The false positive rate. This is the percentage of total legitimate events that are incorrectly predicted as fraud.
precision (float) --
The percentage of fraud events correctly predicted as fraudulent as compared to all events predicted as fraudulent.
tpr (float) --
The true positive rate. This is the percentage of total fraud the model detects. Also known as capture rate.
threshold (float) --
The model threshold that specifies an acceptable fraud capture rate. For example, a threshold of 500 means any model score 500 or above is labeled as fraud.
variableImportanceMetrics (dict) --
The variable importance metrics.
LogitMetrics (list) --
List of variable metrics.
(dict) --
The logit metric details.
variableName (string) --
The name of the variable.
variableType (string) --
The type of variable.
variableImportance (float) --
The relative importance of the variable.
lastUpdatedTime (string) --
The timestamp when the model was last updated.
createdTime (string) --
The timestamp when the model was created.
arn (string) --
The model version ARN.
nextToken (string) --
The next token.
Exceptions
Generate a presigned url given a client, its method, and arguments
The presigned url
Gets all batch prediction jobs or a specific job if you specify a job ID. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 50 records per page. If you provide a maxResults, the value must be between 1 and 50. To get the next page results, provide the pagination token from the GetBatchPredictionJobsResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_batch_prediction_jobs(
jobId='string',
maxResults=123,
nextToken='string'
)
dict
Response Syntax
{
'batchPredictions': [
{
'jobId': 'string',
'status': 'IN_PROGRESS_INITIALIZING'|'IN_PROGRESS'|'CANCEL_IN_PROGRESS'|'CANCELED'|'COMPLETE'|'FAILED',
'failureReason': 'string',
'startTime': 'string',
'completionTime': 'string',
'lastHeartbeatTime': 'string',
'inputPath': 'string',
'outputPath': 'string',
'eventTypeName': 'string',
'detectorName': 'string',
'detectorVersion': 'string',
'iamRoleArn': 'string',
'arn': 'string',
'processedRecordsCount': 123,
'totalRecordsCount': 123
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
batchPredictions (list) --
An array containing the details of each batch prediction job.
(dict) --
The batch prediction details.
jobId (string) --
The job ID for the batch prediction.
status (string) --
The batch prediction status.
failureReason (string) --
The reason a batch prediction job failed.
startTime (string) --
Timestamp of when the batch prediction job started.
completionTime (string) --
Timestamp of when the batch prediction job comleted.
lastHeartbeatTime (string) --
Timestamp of most recent heartbeat indicating the batch prediction job was making progress.
inputPath (string) --
The Amazon S3 location of your training file.
outputPath (string) --
The Amazon S3 location of your output file.
eventTypeName (string) --
The name of the event type.
detectorName (string) --
The name of the detector.
detectorVersion (string) --
The detector version.
iamRoleArn (string) --
The ARN of the IAM role to use for this job request.
arn (string) --
The ARN of batch prediction job.
processedRecordsCount (integer) --
The number of records processed by the batch prediction job.
totalRecordsCount (integer) --
The total number of records in the batch prediction job.
nextToken (string) --
The next token for the subsequent request.
Exceptions
Gets a particular detector version.
See also: AWS API Documentation
Request Syntax
response = client.get_detector_version(
detectorId='string',
detectorVersionId='string'
)
[REQUIRED]
The detector ID.
[REQUIRED]
The detector version ID.
dict
Response Syntax
{
'detectorId': 'string',
'detectorVersionId': 'string',
'description': 'string',
'externalModelEndpoints': [
'string',
],
'modelVersions': [
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'arn': 'string'
},
],
'rules': [
{
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
},
],
'status': 'DRAFT'|'ACTIVE'|'INACTIVE',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'ruleExecutionMode': 'ALL_MATCHED'|'FIRST_MATCHED',
'arn': 'string'
}
Response Structure
(dict) --
detectorId (string) --
The detector ID.
detectorVersionId (string) --
The detector version ID.
description (string) --
The detector version description.
externalModelEndpoints (list) --
The Amazon SageMaker model endpoints included in the detector version.
modelVersions (list) --
The model versions included in the detector version.
(dict) --
The model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
arn (string) --
The model version ARN.
rules (list) --
The rules included in the detector version.
(dict) --
A rule.
detectorId (string) --
The detector for which the rule is associated.
ruleId (string) --
The rule ID.
ruleVersion (string) --
The rule version.
status (string) --
The status of the detector version.
lastUpdatedTime (string) --
The timestamp when the detector version was last updated.
createdTime (string) --
The timestamp when the detector version was created.
ruleExecutionMode (string) --
The execution mode of the rule in the dectector
FIRST_MATCHED indicates that 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.
ALL_MATCHED indicates that Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status.
arn (string) --
The detector version ARN.
Exceptions
Gets all detectors or a single detector if a detectorId is specified. This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 10 records per page. If you provide a maxResults , the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetDetectorsResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_detectors(
detectorId='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'detectors': [
{
'detectorId': 'string',
'description': 'string',
'eventTypeName': 'string',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
detectors (list) --
The detectors.
(dict) --
The detector.
detectorId (string) --
The detector ID.
description (string) --
The detector description.
eventTypeName (string) --
The name of the event type.
lastUpdatedTime (string) --
Timestamp of when the detector was last updated.
createdTime (string) --
Timestamp of when the detector was created.
arn (string) --
The detector ARN.
nextToken (string) --
The next page token.
Exceptions
Gets all entity types or a specific entity type if a name is specified. This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 10 records per page. If you provide a maxResults , the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEntityTypesResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_entity_types(
name='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'entityTypes': [
{
'name': 'string',
'description': 'string',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
entityTypes (list) --
An array of entity types.
(dict) --
The entity type details.
name (string) --
The entity type name.
description (string) --
The entity type description.
lastUpdatedTime (string) --
Timestamp of when the entity type was last updated.
createdTime (string) --
Timestamp of when the entity type was created.
arn (string) --
The entity type ARN.
nextToken (string) --
The next page token.
Exceptions
Evaluates an event against a detector version. If a version ID is not provided, the detector’s (ACTIVE ) version is used.
See also: AWS API Documentation
Request Syntax
response = client.get_event_prediction(
detectorId='string',
detectorVersionId='string',
eventId='string',
eventTypeName='string',
entities=[
{
'entityType': 'string',
'entityId': 'string'
},
],
eventTimestamp='string',
eventVariables={
'string': 'string'
},
externalModelEndpointDataBlobs={
'string': {
'byteBuffer': b'bytes',
'contentType': 'string'
}
}
)
[REQUIRED]
The detector ID.
[REQUIRED]
The unique ID used to identify the event.
[REQUIRED]
The event type associated with the detector specified for the prediction.
[REQUIRED]
The entity type (associated with the detector's event type) and specific entity ID representing who performed the event. If an entity id is not available, use "UNKNOWN."
The entity details.
The entity type.
The entity ID. If you do not know the entityId , you can pass unknown , which is areserved string literal.
[REQUIRED]
Timestamp that defines when the event under evaluation occurred.
[REQUIRED]
Names of the event type's variables you defined in Amazon Fraud Detector to represent data elements and their corresponding values for the event you are sending for evaluation.
Warning
To ensure highest possible fraud prediction and to simplify your data preparation, Amazon Fraud Detector will replace all missing variables or values as follows:
For Amazon Fraud Detector trained models:
If a null value is provided explicitly for a variable or if a variable is missing, model will replace the null value or the missing variable (no variable name in the eventVariables map) with calculated default mean/medians for numeric variables and with special values for categorical variables.
For External models ( for example, imported SageMaker):
If a null value is provided explicitly for a variable, the model and rules will use “null” as the value. If a variable is not provided (no variable name in the eventVariables map), model and rules will use the default value that is provided for the variable.
The Amazon SageMaker model endpoint input data blobs.
A pre-formed Amazon SageMaker model input you can include if your detector version includes an imported Amazon SageMaker model endpoint with pass-through input configuration.
The byte buffer of the Amazon SageMaker model endpoint input data blob.
The content type of the Amazon SageMaker model endpoint input data blob.
dict
Response Syntax
{
'modelScores': [
{
'modelVersion': {
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'arn': 'string'
},
'scores': {
'string': ...
}
},
],
'ruleResults': [
{
'ruleId': 'string',
'outcomes': [
'string',
]
},
]
}
Response Structure
(dict) --
modelScores (list) --
The model scores. Amazon Fraud Detector generates model scores between 0 and 1000, where 0 is low fraud risk and 1000 is high fraud risk. Model scores are directly related to the false positive rate (FPR). For example, a score of 600 corresponds to an estimated 10% false positive rate whereas a score of 900 corresponds to an estimated 2% false positive rate.
(dict) --
The fraud prediction scores.
modelVersion (dict) --
The model version.
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
arn (string) --
The model version ARN.
scores (dict) --
The model's fraud prediction scores.
ruleResults (list) --
The results.
(dict) --
The rule results.
ruleId (string) --
The rule ID that was matched, based on the rule execution mode.
outcomes (list) --
The outcomes of the matched rule, based on the rule execution mode.
Exceptions
Gets all event types or a specific event type if name is provided. This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 10 records per page. If you provide a maxResults , the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEventTypesResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_event_types(
name='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'eventTypes': [
{
'name': 'string',
'description': 'string',
'eventVariables': [
'string',
],
'labels': [
'string',
],
'entityTypes': [
'string',
],
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
eventTypes (list) --
An array of event types.
(dict) --
The event type details.
name (string) --
The event type name.
description (string) --
The event type description.
eventVariables (list) --
The event type event variables.
labels (list) --
The event type labels.
entityTypes (list) --
The event type entity types.
lastUpdatedTime (string) --
Timestamp of when the event type was last updated.
createdTime (string) --
Timestamp of when the event type was created.
arn (string) --
The entity type ARN.
nextToken (string) --
The next page token.
Exceptions
Gets the details for one or more Amazon SageMaker models that have been imported into the service. This is a paginated API. If you provide a null maxResults , this actions retrieves a maximum of 10 records per page. If you provide a maxResults , the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetExternalModelsResult as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_external_models(
modelEndpoint='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'externalModels': [
{
'modelEndpoint': 'string',
'modelSource': 'SAGEMAKER',
'invokeModelEndpointRoleArn': 'string',
'inputConfiguration': {
'eventTypeName': 'string',
'format': 'TEXT_CSV'|'APPLICATION_JSON',
'useEventVariables': True|False,
'jsonInputTemplate': 'string',
'csvInputTemplate': 'string'
},
'outputConfiguration': {
'format': 'TEXT_CSV'|'APPLICATION_JSONLINES',
'jsonKeyToVariableMap': {
'string': 'string'
},
'csvIndexToVariableMap': {
'string': 'string'
}
},
'modelEndpointStatus': 'ASSOCIATED'|'DISSOCIATED',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
externalModels (list) --
Gets the Amazon SageMaker models.
(dict) --
The Amazon SageMaker model.
modelEndpoint (string) --
The Amazon SageMaker model endpoints.
modelSource (string) --
The source of the model.
invokeModelEndpointRoleArn (string) --
The role used to invoke the model.
inputConfiguration (dict) --
The input configuration.
eventTypeName (string) --
The event type name.
format (string) --
The format of the model input configuration. The format differs depending on if it is passed through to SageMaker or constructed by Amazon Fraud Detector.
useEventVariables (boolean) --
The event variables.
jsonInputTemplate (string) --
Template for constructing the JSON input-data sent to SageMaker. At event-evaluation, the placeholders for variable names in the template will be replaced with the variable values before being sent to SageMaker.
csvInputTemplate (string) --
Template for constructing the CSV input-data sent to SageMaker. At event-evaluation, the placeholders for variable-names in the template will be replaced with the variable values before being sent to SageMaker.
outputConfiguration (dict) --
The output configuration.
format (string) --
The format of the model output configuration.
jsonKeyToVariableMap (dict) --
A map of JSON keys in response from SageMaker to the Amazon Fraud Detector variables.
csvIndexToVariableMap (dict) --
A map of CSV index values in the SageMaker response to the Amazon Fraud Detector variables.
modelEndpointStatus (string) --
The Amazon Fraud Detector status for the external model endpoint
lastUpdatedTime (string) --
Timestamp of when the model was last updated.
createdTime (string) --
Timestamp of when the model was last created.
arn (string) --
The model ARN.
nextToken (string) --
The next page token to be used in subsequent requests.
Exceptions
Gets the encryption key if a Key Management Service (KMS) customer master key (CMK) has been specified to be used to encrypt content in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.get_kms_encryption_key()
{
'kmsKey': {
'kmsEncryptionKeyArn': 'string'
}
}
Response Structure
The KMS encryption key.
The encryption key ARN.
Exceptions
Gets all labels or a specific label if name is provided. This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 50 records per page. If you provide a maxResults , the value must be between 10 and 50. To get the next page results, provide the pagination token from the GetGetLabelsResponse as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_labels(
name='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'labels': [
{
'name': 'string',
'description': 'string',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
labels (list) --
An array of labels.
(dict) --
The label details.
name (string) --
The label name.
description (string) --
The label description.
lastUpdatedTime (string) --
Timestamp of when the label was last updated.
createdTime (string) --
Timestamp of when the event type was created.
arn (string) --
The label ARN.
nextToken (string) --
The next page token.
Exceptions
Gets the details of the specified model version.
See also: AWS API Documentation
Request Syntax
response = client.get_model_version(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
modelVersionNumber='string'
)
[REQUIRED]
The model ID.
[REQUIRED]
The model type.
[REQUIRED]
The model version number.
dict
Response Syntax
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'trainingDataSource': 'EXTERNAL_EVENTS',
'trainingDataSchema': {
'modelVariables': [
'string',
],
'labelSchema': {
'labelMapper': {
'string': [
'string',
]
}
}
},
'externalEventsDetail': {
'dataLocation': 'string',
'dataAccessRoleArn': 'string'
},
'status': 'string',
'arn': 'string'
}
Response Structure
(dict) --
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number.
trainingDataSource (string) --
The training data source.
trainingDataSchema (dict) --
The training data schema.
modelVariables (list) --
The training data schema variables.
labelSchema (dict) --
The label schema.
labelMapper (dict) --
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.
externalEventsDetail (dict) --
The event details.
dataLocation (string) --
The Amazon S3 bucket location for the data.
dataAccessRoleArn (string) --
The ARN of the role that provides Amazon Fraud Detector access to the data location.
status (string) --
The model version status.
Possible values are:
arn (string) --
The model version ARN.
Exceptions
Gets one or more models. Gets all models for the AWS account if no model type and no model id provided. Gets all models for the AWS account and model type, if the model type is specified but model id is not provided. Gets a specific model if (model type, model id) tuple is specified.
This is a paginated API. If you provide a null maxResults , this action retrieves a maximum of 10 records per page. If you provide a maxResults , the value must be between 1 and 10. To get the next page results, provide the pagination token from the response as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_models(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'nextToken': 'string',
'models': [
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'description': 'string',
'eventTypeName': 'string',
'createdTime': 'string',
'lastUpdatedTime': 'string',
'arn': 'string'
},
]
}
Response Structure
(dict) --
nextToken (string) --
The next page token to be used in subsequent requests.
models (list) --
The array of models.
(dict) --
The model.
modelId (string) --
The model ID.
modelType (string) --
The model type.
description (string) --
The model description.
eventTypeName (string) --
The name of the event type.
createdTime (string) --
Timestamp of when the model was created.
lastUpdatedTime (string) --
Timestamp of last time the model was updated.
arn (string) --
The ARN of the model.
Exceptions
Gets one or more outcomes. This is a paginated API. If you provide a null maxResults , this actions retrieves a maximum of 100 records per page. If you provide a maxResults , the value must be between 50 and 100. To get the next page results, provide the pagination token from the GetOutcomesResult as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_outcomes(
name='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'outcomes': [
{
'name': 'string',
'description': 'string',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
outcomes (list) --
The outcomes.
(dict) --
The outcome.
name (string) --
The outcome name.
description (string) --
The outcome description.
lastUpdatedTime (string) --
The timestamp when the outcome was last updated.
createdTime (string) --
The timestamp when the outcome was created.
arn (string) --
The outcome ARN.
nextToken (string) --
The next page token for subsequent requests.
Exceptions
Create a paginator for an operation.
Get all rules for a detector (paginated) if ruleId and ruleVersion are not specified. Gets all rules for the detector and the ruleId if present (paginated). Gets a specific rule if both the ruleId and the ruleVersion are specified.
This is a paginated API. Providing null maxResults results in retrieving maximum of 100 records per page. If you provide maxResults the value must be between 50 and 100. To get the next page result, a provide a pagination token from GetRulesResult as part of your request. Null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_rules(
ruleId='string',
detectorId='string',
ruleVersion='string',
nextToken='string',
maxResults=123
)
[REQUIRED]
The detector ID.
dict
Response Syntax
{
'ruleDetails': [
{
'ruleId': 'string',
'description': 'string',
'detectorId': 'string',
'ruleVersion': 'string',
'expression': 'string',
'language': 'DETECTORPL',
'outcomes': [
'string',
],
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
ruleDetails (list) --
The details of the requested rule.
(dict) --
The details of the rule.
ruleId (string) --
The rule ID.
description (string) --
The rule description.
detectorId (string) --
The detector for which the rule is associated.
ruleVersion (string) --
The rule version.
expression (string) --
The rule expression.
language (string) --
The rule language.
outcomes (list) --
The rule outcomes.
lastUpdatedTime (string) --
Timestamp of the last time the rule was updated.
createdTime (string) --
The timestamp of when the rule was created.
arn (string) --
The rule ARN.
nextToken (string) --
The next page token to be used in subsequent requests.
Exceptions
Gets all of the variables or the specific variable. This is a paginated API. Providing null maxSizePerPage results in retrieving maximum of 100 records per page. If you provide maxSizePerPage the value must be between 50 and 100. To get the next page result, a provide a pagination token from GetVariablesResult as part of your request. Null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.get_variables(
name='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'variables': [
{
'name': 'string',
'dataType': 'STRING'|'INTEGER'|'FLOAT'|'BOOLEAN',
'dataSource': 'EVENT'|'MODEL_SCORE'|'EXTERNAL_MODEL_SCORE',
'defaultValue': 'string',
'description': 'string',
'variableType': 'string',
'lastUpdatedTime': 'string',
'createdTime': 'string',
'arn': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
variables (list) --
The names of the variables returned.
(dict) --
The variable.
name (string) --
The name of the variable.
dataType (string) --
The data type of the variable. For more information see Variable types .
dataSource (string) --
The data source of the variable.
defaultValue (string) --
The default value of the variable.
description (string) --
The description of the variable.
variableType (string) --
The variable type of the variable.
Valid Values: AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT
lastUpdatedTime (string) --
The time when variable was last updated.
createdTime (string) --
The time when the variable was created.
arn (string) --
The ARN of the variable.
nextToken (string) --
The next page token to be used in subsequent requests.
Exceptions
Returns an object that can wait for some condition.
Lists all tags associated with the resource. This is a paginated API. To get the next page results, provide the pagination token from the response as part of your request. A null pagination token fetches the records from the beginning.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
resourceARN='string',
nextToken='string',
maxResults=123
)
[REQUIRED]
The ARN that specifies the resource whose tags you want to list.
dict
Response Syntax
{
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
tags (list) --
A collection of key and value pairs.
(dict) --
A key and value pair.
key (string) --
A tag key.
value (string) --
A value assigned to a tag key.
nextToken (string) --
The next token for subsequent requests.
Exceptions
Creates or updates a detector.
See also: AWS API Documentation
Request Syntax
response = client.put_detector(
detectorId='string',
description='string',
eventTypeName='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The detector ID.
[REQUIRED]
The name of the event type.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Creates or updates an entity type. An entity represents who is performing the event. As part of a fraud prediction, you pass the entity ID to indicate the specific entity who performed the event. An entity type classifies the entity. Example classifications include customer, merchant, or account.
See also: AWS API Documentation
Request Syntax
response = client.put_entity_type(
name='string',
description='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name of the entity type.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Creates or updates an event type. An event is a business activity that is evaluated for fraud risk. With Amazon Fraud Detector, you generate fraud predictions for events. An event type defines the structure for an event sent to Amazon Fraud Detector. This includes the variables sent as part of the event, the entity performing the event (such as a customer), and the labels that classify the event. Example event types include online payment transactions, account registrations, and authentications.
See also: AWS API Documentation
Request Syntax
response = client.put_event_type(
name='string',
description='string',
eventVariables=[
'string',
],
labels=[
'string',
],
entityTypes=[
'string',
],
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name.
[REQUIRED]
The event type variables.
The event type labels.
[REQUIRED]
The entity type for the event type. Example entity types: customer, merchant, account.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Creates or updates an Amazon SageMaker model endpoint. You can also use this action to update the configuration of the model endpoint, including the IAM role and/or the mapped variables.
See also: AWS API Documentation
Request Syntax
response = client.put_external_model(
modelEndpoint='string',
modelSource='SAGEMAKER',
invokeModelEndpointRoleArn='string',
inputConfiguration={
'eventTypeName': 'string',
'format': 'TEXT_CSV'|'APPLICATION_JSON',
'useEventVariables': True|False,
'jsonInputTemplate': 'string',
'csvInputTemplate': 'string'
},
outputConfiguration={
'format': 'TEXT_CSV'|'APPLICATION_JSONLINES',
'jsonKeyToVariableMap': {
'string': 'string'
},
'csvIndexToVariableMap': {
'string': 'string'
}
},
modelEndpointStatus='ASSOCIATED'|'DISSOCIATED',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The model endpoints name.
[REQUIRED]
The source of the model.
[REQUIRED]
The IAM role used to invoke the model endpoint.
[REQUIRED]
The model endpoint input configuration.
The event type name.
The format of the model input configuration. The format differs depending on if it is passed through to SageMaker or constructed by Amazon Fraud Detector.
The event variables.
Template for constructing the JSON input-data sent to SageMaker. At event-evaluation, the placeholders for variable names in the template will be replaced with the variable values before being sent to SageMaker.
Template for constructing the CSV input-data sent to SageMaker. At event-evaluation, the placeholders for variable-names in the template will be replaced with the variable values before being sent to SageMaker.
[REQUIRED]
The model endpoint output configuration.
The format of the model output configuration.
A map of JSON keys in response from SageMaker to the Amazon Fraud Detector variables.
A map of CSV index values in the SageMaker response to the Amazon Fraud Detector variables.
[REQUIRED]
The model endpoint’s status in Amazon Fraud Detector.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Specifies the Key Management Service (KMS) customer master key (CMK) to be used to encrypt content in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.put_kms_encryption_key(
kmsEncryptionKeyArn='string'
)
[REQUIRED]
The KMS encryption key ARN.
{}
Response Structure
Exceptions
Creates or updates label. A label classifies an event as fraudulent or legitimate. Labels are associated with event types and used to train supervised machine learning models in Amazon Fraud Detector.
See also: AWS API Documentation
Request Syntax
response = client.put_label(
name='string',
description='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The label name.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Creates or updates an outcome.
See also: AWS API Documentation
Request Syntax
response = client.put_outcome(
name='string',
description='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The name of the outcome.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Assigns tags to a resource.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
resourceARN='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The resource ARN.
[REQUIRED]
The tags to assign to the resource.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{}
Response Structure
Exceptions
Removes tags from a resource.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
resourceARN='string',
tagKeys=[
'string',
]
)
[REQUIRED]
The ARN of the resource from which to remove the tag.
[REQUIRED]
The resource ARN.
dict
Response Syntax
{}
Response Structure
Exceptions
Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a DRAFT detector version.
See also: AWS API Documentation
Request Syntax
response = client.update_detector_version(
detectorId='string',
detectorVersionId='string',
externalModelEndpoints=[
'string',
],
rules=[
{
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
},
],
description='string',
modelVersions=[
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'arn': 'string'
},
],
ruleExecutionMode='ALL_MATCHED'|'FIRST_MATCHED'
)
[REQUIRED]
The parent detector ID for the detector version you want to update.
[REQUIRED]
The detector version ID.
[REQUIRED]
The Amazon SageMaker model endpoints to include in the detector version.
[REQUIRED]
The rules to include in the detector version.
A rule.
The detector for which the rule is associated.
The rule ID.
The rule version.
The model versions to include in the detector version.
The model version.
The model ID.
The model type.
The model version number.
The model version ARN.
The rule execution mode to add to the detector.
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. You can define and edit the rule mode at the detector version level, when it is in draft status.
The default behavior is FIRST_MATCHED .
dict
Response Syntax
{}
Response Structure
Exceptions
Updates the detector version's description. You can update the metadata for any detector version (DRAFT, ACTIVE, or INACTIVE ).
See also: AWS API Documentation
Request Syntax
response = client.update_detector_version_metadata(
detectorId='string',
detectorVersionId='string',
description='string'
)
[REQUIRED]
The detector ID.
[REQUIRED]
The detector version ID.
[REQUIRED]
The description.
dict
Response Syntax
{}
Response Structure
Exceptions
Updates the detector version’s status. You can perform the following promotions or demotions using UpdateDetectorVersionStatus : DRAFT to ACTIVE , ACTIVE to INACTIVE , and INACTIVE to ACTIVE .
See also: AWS API Documentation
Request Syntax
response = client.update_detector_version_status(
detectorId='string',
detectorVersionId='string',
status='DRAFT'|'ACTIVE'|'INACTIVE'
)
[REQUIRED]
The detector ID.
[REQUIRED]
The detector version ID.
[REQUIRED]
The new status.
dict
Response Syntax
{}
Response Structure
Exceptions
Updates a model. You can update the description attribute using this action.
See also: AWS API Documentation
Request Syntax
response = client.update_model(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
description='string'
)
[REQUIRED]
The model ID.
[REQUIRED]
The model type.
dict
Response Syntax
{}
Response Structure
Exceptions
Updates a model version. Updating a model version retrains an existing model version using updated training data and produces a new minor version of the model. You can update the training data set location and data access role attributes using this action. This action creates and trains a new minor version of the model, for example version 1.01, 1.02, 1.03.
See also: AWS API Documentation
Request Syntax
response = client.update_model_version(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
majorVersionNumber='string',
externalEventsDetail={
'dataLocation': 'string',
'dataAccessRoleArn': 'string'
},
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The model ID.
[REQUIRED]
The model type.
[REQUIRED]
The major version number.
The event details.
The Amazon S3 bucket location for the data.
The ARN of the role that provides Amazon Fraud Detector access to the data location.
A collection of key and value pairs.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{
'modelId': 'string',
'modelType': 'ONLINE_FRAUD_INSIGHTS',
'modelVersionNumber': 'string',
'status': 'string'
}
Response Structure
(dict) --
modelId (string) --
The model ID.
modelType (string) --
The model type.
modelVersionNumber (string) --
The model version number of the model version updated.
status (string) --
The status of the updated model version.
Exceptions
Updates the status of a model version.
You can perform the following status updates:
See also: AWS API Documentation
Request Syntax
response = client.update_model_version_status(
modelId='string',
modelType='ONLINE_FRAUD_INSIGHTS',
modelVersionNumber='string',
status='ACTIVE'|'INACTIVE'|'TRAINING_CANCELLED'
)
[REQUIRED]
The model ID of the model version to update.
[REQUIRED]
The model type.
[REQUIRED]
The model version number.
[REQUIRED]
The model version status.
dict
Response Syntax
{}
Response Structure
Exceptions
Updates a rule's metadata. The description attribute can be updated.
See also: AWS API Documentation
Request Syntax
response = client.update_rule_metadata(
rule={
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
},
description='string'
)
[REQUIRED]
The rule to update.
The detector for which the rule is associated.
The rule ID.
The rule version.
[REQUIRED]
The rule description.
dict
Response Syntax
{}
Response Structure
Exceptions
Updates a rule version resulting in a new rule version. Updates a rule version resulting in a new rule version (version 1, 2, 3 ...).
See also: AWS API Documentation
Request Syntax
response = client.update_rule_version(
rule={
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
},
description='string',
expression='string',
language='DETECTORPL',
outcomes=[
'string',
],
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
[REQUIRED]
The rule to update.
The detector for which the rule is associated.
The rule ID.
The rule version.
[REQUIRED]
The rule expression.
[REQUIRED]
The language.
[REQUIRED]
The outcomes.
The tags to assign to the rule version.
A key and value pair.
A tag key.
A value assigned to a tag key.
dict
Response Syntax
{
'rule': {
'detectorId': 'string',
'ruleId': 'string',
'ruleVersion': 'string'
}
}
Response Structure
(dict) --
rule (dict) --
The new rule version that was created.
detectorId (string) --
The detector for which the rule is associated.
ruleId (string) --
The rule ID.
ruleVersion (string) --
The rule version.
Exceptions
Updates a variable.
See also: AWS API Documentation
Request Syntax
response = client.update_variable(
name='string',
defaultValue='string',
description='string',
variableType='string'
)
[REQUIRED]
The name of the variable.
dict
Response Syntax
{}
Response Structure
Exceptions
The available paginators are: