DescribeOptOutListsCommand

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.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { PinpointSMSVoiceV2Client, DescribeOptOutListsCommand } from "@aws-sdk/client-pinpoint-sms-voice-v2"; // ES Modules import
// const { PinpointSMSVoiceV2Client, DescribeOptOutListsCommand } = require("@aws-sdk/client-pinpoint-sms-voice-v2"); // CommonJS import
const client = new PinpointSMSVoiceV2Client(config);
const input = { // DescribeOptOutListsRequest
  OptOutListNames: [ // OptOutListNameList
    "STRING_VALUE",
  ],
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
  Owner: "STRING_VALUE",
};
const command = new DescribeOptOutListsCommand(input);
const response = await client.send(command);
// { // DescribeOptOutListsResult
//   OptOutLists: [ // OptOutListInformationList
//     { // OptOutListInformation
//       OptOutListArn: "STRING_VALUE", // required
//       OptOutListName: "STRING_VALUE", // required
//       CreatedTimestamp: new Date("TIMESTAMP"), // required
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

DescribeOptOutListsCommand Input

See DescribeOptOutListsCommandInput for more details

Parameter
Type
Description
MaxResults
number | undefined

The maximum number of results to return per each request.

NextToken
string | undefined

The token to be used for the next set of paginated results. You don't need to supply a value for this field in the initial request.

OptOutListNames
string[] | undefined

The OptOutLists to show the details of. This is an array of strings that can be either the OptOutListName or OptOutListArn.

If you are using a shared AWS End User Messaging SMS and Voice resource then you must use the full Amazon Resource Name(ARN).

Owner
Owner | undefined

Use SELF to filter the list of Opt-Out List to ones your account owns or use SHARED to filter on Opt-Out List shared with your account. The Owner and OptOutListNames parameters can't be used at the same time.

DescribeOptOutListsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
NextToken
string | undefined

The token to be used for the next set of paginated results. If this field is empty then there are no more results.

OptOutLists
OptOutListInformation[] | undefined

An array of OptOutListInformation objects that contain the details for the requested OptOutLists.

Throws

Name
Fault
Details
AccessDeniedException
client

The request was denied because you don't have sufficient permissions to access the resource.

InternalServerException
server

The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.

ResourceNotFoundException
client

A requested resource couldn't be found.

ThrottlingException
client

An error that occurred because too many requests were sent during a certain amount of time.

ValidationException
client

A validation exception for a field.

PinpointSMSVoiceV2ServiceException
Base exception class for all service exceptions from PinpointSMSVoiceV2 service.