---
title: "POST /#X-Amz-Target=TrentService.ListKeys"
method: POST
path: "/#X-Amz-Target=TrentService.ListKeys"
---

# POST /#X-Amz-Target=TrentService.ListKeys

`POST /#X-Amz-Target=TrentService.ListKeys`

Gets a list of all KMS keys in the caller's Amazon Web Services account and Region.

**Cross-account use**: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.

**Required permissions**: [kms:ListKeys](https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) (IAM policy)

**Related operations:**

*   CreateKey
    
*   DescribeKey
    
*   ListAliases
    
*   ListResourceTags

## Query parameters

- `Limit` string
- `Marker` string

## Headers

- `X-Amz-Target` 'TrentService.ListKeys', required

## Request body

- ListKeysRequest
  - `Limit` integer — <p>Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.</p> <p>This value is optional. If you include a value, it must be between 1 and 1000, inclusive. If you do not include a value, it defaults to 100.</p>
  - `Marker` string — Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextMarker</code> from the truncated response you just received.

## Response `200`

Success

- ListKeysResponse
  - `Keys` KeyListEntry[] — A list of KMS keys.
    - `KeyId` string — Unique identifier of the key.
    - `KeyArn` string — ARN of the key.
  - `NextMarker` string — When <code>Truncated</code> is true, this element is present and contains the value to use for the <code>Marker</code> parameter in a subsequent request.
  - `Truncated` boolean — A flag that indicates whether there are more items in the list. When this value is true, the list in this response is truncated. To get more items, pass the value of the <code>NextMarker</code> element in thisresponse to the <code>Marker</code> parameter in a subsequent request.

## Other responses

- `480` — DependencyTimeoutException
- `481` — KMSInternalException
- `482` — InvalidMarkerException

---

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