ListIntentsCommand

Get a list of intents that meet the specified criteria.

Example Syntax

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

import { LexModelsV2Client, ListIntentsCommand } from "@aws-sdk/client-lex-models-v2"; // ES Modules import
// const { LexModelsV2Client, ListIntentsCommand } = require("@aws-sdk/client-lex-models-v2"); // CommonJS import
const client = new LexModelsV2Client(config);
const input = { // ListIntentsRequest
  botId: "STRING_VALUE", // required
  botVersion: "STRING_VALUE", // required
  localeId: "STRING_VALUE", // required
  sortBy: { // IntentSortBy
    attribute: "IntentName" || "LastUpdatedDateTime", // required
    order: "Ascending" || "Descending", // required
  },
  filters: [ // IntentFilters
    { // IntentFilter
      name: "IntentName", // required
      values: [ // FilterValues // required
        "STRING_VALUE",
      ],
      operator: "CO" || "EQ", // required
    },
  ],
  maxResults: Number("int"),
  nextToken: "STRING_VALUE",
};
const command = new ListIntentsCommand(input);
const response = await client.send(command);
// { // ListIntentsResponse
//   botId: "STRING_VALUE",
//   botVersion: "STRING_VALUE",
//   localeId: "STRING_VALUE",
//   intentSummaries: [ // IntentSummaryList
//     { // IntentSummary
//       intentId: "STRING_VALUE",
//       intentName: "STRING_VALUE",
//       description: "STRING_VALUE",
//       parentIntentSignature: "STRING_VALUE",
//       inputContexts: [ // InputContextsList
//         { // InputContext
//           name: "STRING_VALUE", // required
//         },
//       ],
//       outputContexts: [ // OutputContextsList
//         { // OutputContext
//           name: "STRING_VALUE", // required
//           timeToLiveInSeconds: Number("int"), // required
//           turnsToLive: Number("int"), // required
//         },
//       ],
//       lastUpdatedDateTime: new Date("TIMESTAMP"),
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

ListIntentsCommand Input

See ListIntentsCommandInput for more details

Parameter
Type
Description
botId
Required
string | undefined

The unique identifier of the bot that contains the intent.

botVersion
Required
string | undefined

The version of the bot that contains the intent.

localeId
Required
string | undefined

The identifier of the language and locale of the intents to list. The string must match one of the supported locales. For more information, see Supported languages .

filters
IntentFilter[] | undefined

Provides the specification of a filter used to limit the intents in the response to only those that match the filter specification. You can only specify one filter and only one string to filter on.

maxResults
number | undefined

The maximum number of intents to return in each page of results. If there are fewer results than the max page size, only the actual number of results are returned.

nextToken
string | undefined

If the response from the ListIntents operation contains more results than specified in the maxResults parameter, a token is returned in the response.

Use the returned token in the nextToken parameter of a ListIntents request to return the next page of results. For a complete set of results, call the ListIntents operation until the nextToken returned in the response is null.

sortBy
IntentSortBy | undefined

Determines the sort order for the response from the ListIntents operation. You can choose to sort by the intent name or last updated date in either ascending or descending order.

ListIntentsCommand Output

See ListIntentsCommandOutput for details

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

The identifier of the bot that contains the intent.

botVersion
string | undefined

The version of the bot that contains the intent.

intentSummaries
IntentSummary[] | undefined

Summary information for the intents that meet the filter criteria specified in the request. The length of the list is specified in the maxResults parameter of the request. If there are more intents available, the nextToken field contains a token to get the next page of results.

localeId
string | undefined

The language and locale of the intents in the list.

nextToken
string | undefined

A token that indicates whether there are more results to return in a response to the ListIntents operation. If the nextToken field is present, you send the contents as the nextToken parameter of a ListIntents operation request to get the next page of results.

Throws

Name
Fault
Details
InternalServerException
server

The service encountered an unexpected condition. Try your request again.

ServiceQuotaExceededException
client

You have reached a quota for your bot.

ThrottlingException
client

Your request rate is too high. Reduce the frequency of requests.

ValidationException
client

One of the input parameters in your request isn't valid. Check the parameters and try your request again.

LexModelsV2ServiceException
Base exception class for all service exceptions from LexModelsV2 service.