Skip to main content

opt_out_lists

Creates, updates, deletes, gets or lists an opt_out_lists resource.

Overview

Nameopt_out_lists
TypeResource
Idaws.pinpoint_sms_voice_v2.opt_out_lists

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_timestampstring (date-time)The time when the OutOutList was created, in UNIX epoch time format.
opt_out_list_arnstringThe Amazon Resource Name (ARN) of the OptOutList.
opt_out_list_namestringThe name of the OptOutList. (pattern: <code>[A-Za-z0-9_-]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_opt_out_listsselectregionDescribes the specified opt-out list or all opt-out lists in your account. If you specify opt-out list names, the output includes information for only the specified opt-out lists. Opt-out lists include only those that meet the filter criteria. If you don't specify opt-out list names or filters, the output includes information for all opt-out lists. If you specify an opt-out list name that isn't valid, an error is returned.
create_opt_out_listinsertregion, OptOutListNameCreates 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 End User Messaging SMS User Guide.
delete_opt_out_listdeleteregionDeletes an existing opt-out list. All opted out phone numbers in the opt-out list are deleted. If the specified opt-out list name doesn't exist or is in-use by an origination phone number or pool, an error is returned.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Describes the specified opt-out list or all opt-out lists in your account. If you specify opt-out list names, the output includes information for only the specified opt-out lists. Opt-out lists include only those that meet the filter criteria. If you don't specify opt-out list names or filters, the output includes information for all opt-out lists. If you specify an opt-out list name that isn't valid, an error is returned.

SELECT
created_timestamp,
opt_out_list_arn,
opt_out_list_name
FROM aws.pinpoint_sms_voice_v2.opt_out_lists
WHERE region = '{{ region }}' -- required
;

INSERT examples

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 End User Messaging SMS User Guide.

INSERT INTO aws.pinpoint_sms_voice_v2.opt_out_lists (
OptOutListName,
Tags,
ClientToken,
region
)
SELECT
'{{ OptOutListName }}' /* required */,
'{{ Tags }}',
'{{ ClientToken }}',
'{{ region }}'
RETURNING
created_timestamp,
opt_out_list_arn,
opt_out_list_name,
tags
;

DELETE examples

Deletes an existing opt-out list. All opted out phone numbers in the opt-out list are deleted. If the specified opt-out list name doesn't exist or is in-use by an origination phone number or pool, an error is returned.

DELETE FROM aws.pinpoint_sms_voice_v2.opt_out_lists
WHERE region = '{{ region }}' --required
;