---
title: "POST /indices/search"
method: POST
path: "/indices/search"
---

# POST /indices/search

`POST /indices/search`

The query search index.

Requires permission to access the [SearchIndex](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Request body

- object
  - `indexName` string — The search index name.
  - `queryString` string, required — The search query string. For more information about the search query syntax, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html">Query syntax</a>.
  - `nextToken` string — The token used to get the next set of results, or <code>null</code> if there are no additional results.
  - `maxResults` integer — The maximum number of results to return at one time.
  - `queryVersion` string — The query version.

## Response `200`

Success

- SearchIndexResponse
  - `nextToken` string — The token used to get the next set of results, or <code>null</code> if there are no additional results.
  - `things` ThingDocument[] — The things that match the search query.
    - `thingName` string — The thing name.
    - `thingId` string — The thing ID.
    - `thingTypeName` string — The thing type name.
    - `thingGroupNames` ThingGroupName[] — Thing group names.
    - `attributes` object — The attributes.
    - `shadow` string — <p>The unnamed shadow and named shadow.</p> <p>For more information about shadows, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-device-shadows.html">IoT Device Shadow service.</a> </p>
    - `deviceDefender` string — <p>Contains Device Defender data.</p> <p>For more information about Device Defender, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/device-defender.html">Device Defender</a>. </p>
    - `connectivity` object — Indicates whether the thing is connected to the Amazon Web Services IoT Core service.
      - `connected` boolean — True if the thing is connected to the Amazon Web Services IoT Core service; false if it is not connected.
      - `timestamp` integer — The epoch time (in milliseconds) when the thing last connected or disconnected. If the thing has been disconnected for approximately an hour, the time value might be missing.
      - `disconnectReason` string — The reason why the client is disconnected. If the thing has been disconnected for approximately an hour, the <code>disconnectReason</code> value might be missing.
  - `thingGroups` ThingGroupDocument[] — The thing groups that match the search query.
    - `thingGroupName` string — The thing group name.
    - `thingGroupId` string — The thing group ID.
    - `thingGroupDescription` string — The thing group description.
    - `attributes` object — The thing group attributes.
    - `parentGroupNames` ThingGroupName[] — Parent group names.

## Other responses

- `480` — InvalidRequestException
- `481` — ThrottlingException
- `482` — UnauthorizedException
- `483` — ServiceUnavailableException
- `484` — InternalFailureException
- `485` — ResourceNotFoundException
- `486` — InvalidQueryException
- `487` — IndexNotReadyException

---

[API](https://skmtc.net/aws/apis/iot.md) · [All operations](https://skmtc.net/aws/apis/iot/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/iot/revisions/deef5c4b09f0/schema)
