ListOrganizationsCommand

Returns summaries of the customer's organizations.

Example Syntax

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

import { WorkMailClient, ListOrganizationsCommand } from "@aws-sdk/client-workmail"; // ES Modules import
// const { WorkMailClient, ListOrganizationsCommand } = require("@aws-sdk/client-workmail"); // CommonJS import
const client = new WorkMailClient(config);
const input = { // ListOrganizationsRequest
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new ListOrganizationsCommand(input);
const response = await client.send(command);
// { // ListOrganizationsResponse
//   OrganizationSummaries: [ // OrganizationSummaries
//     { // OrganizationSummary
//       OrganizationId: "STRING_VALUE",
//       Alias: "STRING_VALUE",
//       DefaultMailDomain: "STRING_VALUE",
//       ErrorMessage: "STRING_VALUE",
//       State: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListOrganizationsCommand Input

See ListOrganizationsCommandInput for more details

Parameter
Type
Description
MaxResults
number | undefined

The maximum number of results to return in a single call.

NextToken
string | undefined

The token to use to retrieve the next page of results. The first call does not contain any tokens.

ListOrganizationsCommand Output

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

The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.

OrganizationSummaries
OrganizationSummary[] | undefined

The overview of owned organizations presented as a list of organization summaries.

Throws

Name
Fault
Details
InvalidParameterException
client

One or more of the input parameters don't match the service's restrictions.

WorkMailServiceException
Base exception class for all service exceptions from WorkMail service.