SearchEmailAddressesCommand

Searches email address in an instance, with optional filtering.

Example Syntax

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

import { ConnectClient, SearchEmailAddressesCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, SearchEmailAddressesCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // SearchEmailAddressesRequest
  InstanceId: "STRING_VALUE", // required
  MaxResults: Number("int"),
  NextToken: "STRING_VALUE",
  SearchCriteria: { // EmailAddressSearchCriteria
    OrConditions: [ // EmailAddressSearchConditionList
      {
        OrConditions: [
          "<EmailAddressSearchCriteria>",
        ],
        AndConditions: [
          "<EmailAddressSearchCriteria>",
        ],
        StringCondition: { // StringCondition
          FieldName: "STRING_VALUE",
          Value: "STRING_VALUE",
          ComparisonType: "STARTS_WITH" || "CONTAINS" || "EXACT",
        },
      },
    ],
    AndConditions: [
      "<EmailAddressSearchCriteria>",
    ],
    StringCondition: {
      FieldName: "STRING_VALUE",
      Value: "STRING_VALUE",
      ComparisonType: "STARTS_WITH" || "CONTAINS" || "EXACT",
    },
  },
  SearchFilter: { // EmailAddressSearchFilter
    TagFilter: { // ControlPlaneTagFilter
      OrConditions: [ // TagOrConditionList
        [ // TagAndConditionList
          { // TagCondition
            TagKey: "STRING_VALUE",
            TagValue: "STRING_VALUE",
          },
        ],
      ],
      AndConditions: [
        {
          TagKey: "STRING_VALUE",
          TagValue: "STRING_VALUE",
        },
      ],
      TagCondition: "<TagCondition>",
    },
  },
};
const command = new SearchEmailAddressesCommand(input);
const response = await client.send(command);
// { // SearchEmailAddressesResponse
//   NextToken: "STRING_VALUE",
//   EmailAddresses: [ // EmailAddressList
//     { // EmailAddressMetadata
//       EmailAddressId: "STRING_VALUE",
//       EmailAddressArn: "STRING_VALUE",
//       EmailAddress: "STRING_VALUE",
//       Description: "STRING_VALUE",
//       DisplayName: "STRING_VALUE",
//     },
//   ],
//   ApproximateTotalCount: Number("long"),
// };

SearchEmailAddressesCommand Input

Parameter
Type
Description
InstanceId
Required
string | undefined

The identifier of the Amazon Connect instance. You can find the instance ID  in the Amazon Resource Name (ARN) of the instance.

MaxResults
number | undefined

The maximum number of results to return per page.

NextToken
string | undefined

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

SearchCriteria
EmailAddressSearchCriteria | undefined

The search criteria to be used to return email addresses.

SearchFilter
EmailAddressSearchFilter | undefined

Filters to be applied to search results.

SearchEmailAddressesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
ApproximateTotalCount
number | undefined

The total number of email addresses which matched your search query.

EmailAddresses
EmailAddressMetadata[] | undefined

List of email addresses matching SearchFilter and SearchCriteria

NextToken
string | undefined

If there are additional results, this is the token for the next set of results.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient permissions to perform this action.

InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidParameterException
client

One or more of the specified parameters are not valid.

InvalidRequestException
client

The request is not valid.

ResourceNotFoundException
client

The specified resource was not found.

ThrottlingException
client

The throttling limit has been exceeded.

ConnectServiceException
Base exception class for all service exceptions from Connect service.