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

# POST /indices/percentiles

`POST /indices/percentiles`

Groups the aggregated values that match the query into percentile groupings. The default percentile groupings are: 1,5,25,50,75,95,99, although you can specify your own when you call `GetPercentiles`. This function returns a value for each percentile group specified (or the default percentile groupings). The percentile group "1" contains the aggregated field value that occurs in approximately one percent of the values that match the query. The percentile group "5" contains the aggregated field value that occurs in approximately five percent of the values that match the query, and so on. The result is an approximation, the more values that match the query, the more accurate the percentile values.

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

## Request body

- object
  - `indexName` string — The name of the index to search.
  - `queryString` string, required — The search query string.
  - `aggregationField` string — The field to aggregate.
  - `queryVersion` string — The query version.
  - `percents` Percent[] — The percentile groups returned.

## Response `200`

Success

- GetPercentilesResponse
  - `percentiles` PercentPair[] — The percentile values of the aggregated fields.
    - `percent` number, double — The percentile.
    - `value` number, double — The value of the percentile.

## Other responses

- `480` — InvalidRequestException
- `481` — ThrottlingException
- `482` — UnauthorizedException
- `483` — ServiceUnavailableException
- `484` — InternalFailureException
- `485` — ResourceNotFoundException
- `486` — InvalidQueryException
- `487` — InvalidAggregationException
- `488` — 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)
