CreateFilter - Amazon Personalize

CreateFilter

Creates a recommendation filter. For more information, see Using Filters with Amazon Personalize.

Request Syntax

{ "datasetGroupArn": "string", "filterExpression": "string", "name": "string" }

Request Parameters

The request accepts the following data in JSON format.

datasetGroupArn

The ARN of the dataset group that the filter will belong to.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:([a-z\d-]+):personalize:.*:.*:.+

Required: Yes

filterExpression

The filter expression that designates the interaction types that the filter will filter out. A filter expression must follow the following format:

EXCLUDE itemId WHERE INTERACTIONS.event_type in ("EVENT_TYPE")

Where "EVENT_TYPE" is the type of event to filter out. To filter out all items with any interactions history, set "*" as the EVENT_TYPE. For more information, see Using Filters with Amazon Personalize.

Type: String

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

Required: Yes

name

The name of the filter to create.

Type: String

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

Pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*

Required: Yes

Response Syntax

{ "filterArn": "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.

filterArn

The ARN of the new filter.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:([a-z\d-]+):personalize:.*:.*:.+

Errors

InvalidInputException

Provide a valid value for the field or parameter.

HTTP Status Code: 400

LimitExceededException

The limit on the number of requests per second has been exceeded.

HTTP Status Code: 400

ResourceAlreadyExistsException

The specified resource already exists.

HTTP Status Code: 400

ResourceNotFoundException

Could not find the specified resource.

HTTP Status Code: 400

See Also

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