create_opt_out_list

PinpointSMSVoiceV2.Client.create_opt_out_list(**kwargs)

Creates a new opt-out list.

If the opt-out list name already exists, an Error is returned.

An opt-out list is a list of phone numbers that are opted out, meaning you can't send SMS or voice messages to them. If end user replies with the keyword "STOP," an entry for the phone number is added to the opt-out list. In addition to STOP, your recipients can use any supported opt-out keyword, such as CANCEL or OPTOUT. For a list of supported opt-out keywords, see SMS opt out in the Amazon Pinpoint User Guide .

See also: AWS API Documentation

Request Syntax

response = client.create_opt_out_list(
    OptOutListName='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    ClientToken='string'
)
Parameters
  • OptOutListName (string) --

    [REQUIRED]

    The name of the new OptOutList.

  • Tags (list) --

    An array of tags (key and value pairs) to associate with the new OptOutList.

    • (dict) --

      The list of tags to be added to the specified topic.

      • Key (string) -- [REQUIRED]

        The key identifier, or name, of the tag.

      • Value (string) -- [REQUIRED]

        The string value associated with the key of the tag.

  • ClientToken (string) --

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'OptOutListArn': 'string',
    'OptOutListName': 'string',
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    'CreatedTimestamp': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • OptOutListArn (string) --

      The Amazon Resource Name (ARN) for the OptOutList.

    • OptOutListName (string) --

      The name of the new OptOutList.

    • Tags (list) --

      An array of tags (key and value pairs) associated with the new OptOutList.

      • (dict) --

        The list of tags to be added to the specified topic.

        • Key (string) --

          The key identifier, or name, of the tag.

        • Value (string) --

          The string value associated with the key of the tag.

    • CreatedTimestamp (datetime) --

      The time when the pool was created, in UNIX epoch time format.

Exceptions

  • PinpointSMSVoiceV2.Client.exceptions.ServiceQuotaExceededException
  • PinpointSMSVoiceV2.Client.exceptions.ThrottlingException
  • PinpointSMSVoiceV2.Client.exceptions.AccessDeniedException
  • PinpointSMSVoiceV2.Client.exceptions.ValidationException
  • PinpointSMSVoiceV2.Client.exceptions.ConflictException
  • PinpointSMSVoiceV2.Client.exceptions.InternalServerException