GetEventPrediction - Amazon Fraud Detector


Evaluates an event against a detector version. If a version ID is not provided, the detector’s (ACTIVE) version is used.

Request Syntax

{ "detectorId": "string", "detectorVersionId": "string", "entities": [ { "entityId": "string", "entityType": "string" } ], "eventId": "string", "eventTimestamp": "string", "eventTypeName": "string", "eventVariables": { "string" : "string" }, "externalModelEndpointDataBlobs": { "string" : { "byteBuffer": blob, "contentType": "string" } } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


The detector ID.

Type: String

Required: Yes


The detector version ID.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 5.

Pattern: ^([1-9][0-9]*)$

Required: No


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."

Type: Array of Entity objects

Required: Yes


The unique ID used to identify the event.

Type: String

Required: Yes


Timestamp that defines when the event under evaluation occurred. The timestamp must be specified using ISO 8601 standard in UTC.

Type: String

Length Constraints: Minimum length of 10. Maximum length of 30.

Required: Yes


The event type associated with the detector specified for the prediction.

Type: String

Required: Yes


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.


You must provide at least one eventVariable

To ensure most accurate 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 imported SageMaker models:

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.

Type: String to string map

Map Entries: Maximum number of items.

Key Length Constraints: Minimum length of 1. Maximum length of 64.

Value Length Constraints: Minimum length of 1. Maximum length of 8192.

Required: Yes


The Amazon SageMaker model endpoint input data blobs.

Type: String to ModelEndpointDataBlob object map

Key Length Constraints: Minimum length of 1. Maximum length of 63.

Key Pattern: ^[0-9A-Za-z_-]+$

Required: No

Response Syntax

{ "externalModelOutputs": [ { "externalModel": { "modelEndpoint": "string", "modelSource": "string" }, "outputs": { "string" : "string" } } ], "modelScores": [ { "modelVersion": { "arn": "string", "modelId": "string", "modelType": "string", "modelVersionNumber": "string" }, "scores": { "string" : number } } ], "ruleResults": [ { "outcomes": [ "string" ], "ruleId": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The model scores for Amazon SageMaker models.

Type: Array of ExternalModelOutputs objects


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.

Type: Array of ModelScores objects


The results from the rules.

Type: Array of RuleResult objects


For information about the errors that are common to all actions, see Common Errors.


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.

HTTP Status Code: 400


An exception indicating there was a conflict during a delete operation.

HTTP Status Code: 400


An exception indicating an internal server error.

HTTP Status Code: 500


An exception indicating the specified resource was not found.

HTTP Status Code: 400


An exception indicating that the attached customer-owned (external) model threw an exception when Amazon Fraud Detector invoked the model.

HTTP Status Code: 400


An exception indicating a throttling error.

HTTP Status Code: 400


An exception indicating a specified value is not allowed.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: