ListIdentitiesCommand

Returns a list containing all of the identities (email addresses and domains) for your Amazon Web Services account in the current Amazon Web Services Region, regardless of verification status.

You can execute this operation no more than once per second.

It's recommended that for successive pagination calls of this API, you continue to the use the same parameter/value pairs as used in the original call, e.g., if you used IdentityType=Domain in the the original call and received a NextToken in the response, you should continue providing the IdentityType=Domain parameter for further NextToken calls; however, if you didn't provide the IdentityType parameter in the original call, then continue to not provide it for successive pagination calls. Using this protocol will ensure consistent results.

Example Syntax

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

import { SESClient, ListIdentitiesCommand } from "@aws-sdk/client-ses"; // ES Modules import
// const { SESClient, ListIdentitiesCommand } = require("@aws-sdk/client-ses"); // CommonJS import
const client = new SESClient(config);
const input = { // ListIdentitiesRequest
  IdentityType: "EmailAddress" || "Domain",
  NextToken: "STRING_VALUE",
  MaxItems: Number("int"),
};
const command = new ListIdentitiesCommand(input);
const response = await client.send(command);
// { // ListIdentitiesResponse
//   Identities: [ // IdentityList // required
//     "STRING_VALUE",
//   ],
//   NextToken: "STRING_VALUE",
// };

Example Usage

 There was an error loading the code editor. Retry

ListIdentitiesCommand Input

See ListIdentitiesCommandInput for more details

Parameter
Type
Description
IdentityType
IdentityType | undefined

The type of the identities to list. Possible values are "EmailAddress" and "Domain". If this parameter is omitted, then all identities are listed.

MaxItems
number | undefined

The maximum number of identities per page. Possible values are 1-1000 inclusive.

NextToken
string | undefined

The token to use for pagination.

ListIdentitiesCommand Output

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

A list of identities.

NextToken
string | undefined

The token used for pagination.

Throws

Name
Fault
Details
SESServiceException
Base exception class for all service exceptions from SES service.