---
title: "POST /findings/statistics"
method: POST
path: "/findings/statistics"
---

# POST /findings/statistics

`POST /findings/statistics`

Retrieves (queries) aggregated statistical data about findings.

## Request body

- object
  - `findingCriteria` object — Specifies, as a map, one or more property-based conditions that filter the results of a query for findings.
    - `criterion` object — A condition that specifies the property, operator, and one or more values to use to filter the results.
  - `groupBy` 'resourcesAffected.s3Bucket.name' | 'type' | 'classificationDetails.jobId' | 'severity.description', required — <p>The finding property to use to group the query results. Valid values are:</p> <ul><li><p>classificationDetails.jobId - The unique identifier for the classification job that produced the finding.</p></li> <li><p>resourcesAffected.s3Bucket.name - The name of the S3 bucket that the finding applies to.</p></li> <li><p>severity.description - The severity level of the finding, such as High or Medium.</p></li> <li><p>type - The type of finding, such as Policy:IAMUser/S3BucketPublic and SensitiveData:S3Object/Personal.</p></li></ul>
  - `size` integer — The maximum number of items to include in each page of the response.
  - `sortCriteria` object — Specifies criteria for sorting the results of a query that retrieves aggregated statistical data about findings.
    - `attributeName` 'groupKey' | 'count' — The grouping to sort the results by. Valid values are: count, sort the results by the number of findings in each group of results; and, groupKey, sort the results by the name of each group of results.
    - `orderBy` 'ASC' | 'DESC' — The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.

## Response `200`

Success

- GetFindingStatisticsResponse
  - `countsByGroup` GroupCount[] — An array of objects, one for each group of findings that matches the filter criteria specified in the request.
    - `count` integer — The total number of findings in the group of query results.
    - `groupKey` string — The name of the property that defines the group in the query results, as specified by the groupBy property in the query request.

## Other responses

- `480` — ValidationException
- `481` — InternalServerException
- `482` — ServiceQuotaExceededException
- `483` — AccessDeniedException
- `484` — ResourceNotFoundException
- `485` — ThrottlingException
- `486` — ConflictException

---

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