Menu
AWS IoT
Developer Guide

ListThingGroups

List the thing groups in your account.

Request syntax:

GET /thing-groups?maxResults=maxResults&nextToken=nextToken&parentGroup=parentGroup&namePrefixFilter=namePrefixFilter&recursive=recursive

URI Request Parameters:

Name

Type

Req?

Description

nextToken

NextToken

no

The token used to get the next set of results, or null if there are no additional results.

maxResults

RegistryMaxResults

no

The maximum number of results to return at one time.

parentGroup

ThingGroupName

no

A filter that limits the results to those with the specified parent group.

namePrefixFilter

ThingGroupName

no

A filter that limits the results to those with the specified name prefix.

recursive

RecursiveWithoutDefault

no

If true, return child groups as well.

Response syntax:

Content-type: application/json { "thingGroups": [ { "groupName": "string", "groupArn": "string" } ], "nextToken": "string" }

Response Body Parameters:

Name

Type

Req?

Description

thingGroups

ThingGroupNameAndArnList

no

The thing groups.

nextToken

NextToken

no

The token used to get the next set of results, or null if there are no additional results.

Errors:

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

CLI

Synopsis:

aws iot list-thing-groups \ [--next-token <value>] \ [--max-results <value>] \ [--parent-group <value>] \ [--name-prefix-filter <value>] \ [--recursive | --no-recursive] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "nextToken": "string", "maxResults": "integer", "parentGroup": "string", "namePrefixFilter": "string", "recursive": "boolean" }

cli-input-json fields:

Name

Type

Description

nextToken

string

The token used to get the next set of results, or null if there are no additional results.

maxResults

integer

java class: java.lang.Integer

range- max:250 min:1

The maximum number of results to return at one time.

parentGroup

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

A filter that limits the results to those with the specified parent group.

namePrefixFilter

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

A filter that limits the results to those with the specified name prefix.

recursive

boolean

java class: java.lang.Boolean

If true, return child groups as well.

Output:

{ "thingGroups": [ { "groupName": "string", "groupArn": "string" } ], "nextToken": "string" }

cli output fields:

Name

Type

Description

thingGroups

list

member: GroupNameAndArn

java class: java.util.List

The thing groups.

GroupNameAndArn

GroupNameAndArn

groupName

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

The group name.

groupArn

string

The group ARN.

nextToken

string

The token used to get the next set of results, or null if there are no additional results.

On this page: