Personalize / Client / create_filter



Creates a recommendation filter. For more information, see Filtering recommendations and user segments.

See also: AWS API Documentation

Request Syntax

response = client.create_filter(
            'tagKey': 'string',
            'tagValue': 'string'
  • name (string) –


    The name of the filter to create.

  • datasetGroupArn (string) –


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

  • filterExpression (string) –


    The filter expression defines which items are included or excluded from recommendations. Filter expression must follow specific format rules. For information about filter expression structure and syntax, see Filter expressions.

  • tags (list) –

    A list of tags to apply to the filter.

    • (dict) –

      The optional metadata that you apply to resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information see Tagging Personalize resources.

      • tagKey (string) – [REQUIRED]

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

      • tagValue (string) – [REQUIRED]

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

Return type:



Response Syntax

    'filterArn': 'string'

Response Structure

  • (dict) –

    • filterArn (string) –

      The ARN of the new filter.


  • Personalize.Client.exceptions.InvalidInputException

  • Personalize.Client.exceptions.ResourceAlreadyExistsException

  • Personalize.Client.exceptions.ResourceNotFoundException

  • Personalize.Client.exceptions.LimitExceededException

  • Personalize.Client.exceptions.TooManyTagsException