Skip to Content
ZITADEL Docs
APIsCore ResourcesV2Action

List Public Keys

Lists all public keys of a target. The response includes which key is active and the key's expiration dates. This allows you to manage key rotations and ensure that your target always has an active key for payload encryption.

Required permission:

  • action.target.read
POST
/v2/actions/targets/{target_id}/publickeys/search

Path Parameters

target_id*target_id

TargetID is the unique identifier of the target to list the public keys for.

Request Body

application/json
  1. body
pagination?|

List limitations and ordering.

sortingColumn?sorting_column

The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.

Value in"PUBLIC_KEY_FIELD_NAME_UNSPECIFIED""PUBLIC_KEY_FIELD_NAME_CREATION_DATE""PUBLIC_KEY_FIELD_NAME_CHANGE_DATE""PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE"
filters?array<||>

Define the criteria to query for.

Response Body

Success

application/json
  1. response
pagination?

List limitations and ordering.

publicKeys?array<>

List of all public keys for the target.

Example Request
curl -X POST 'https://example.com/v2/actions/targets/string/publickeys/search' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response200
{  "pagination": {    "totalResult": 0,    "appliedLimit": 0  },  "publicKeys": [    {      "keyId": "string",      "active": true,      "publicKey": "string",      "fingerprint": "string",      "expirationDate": "2023-01-15T01:30:15.01Z",      "creationDate": "2023-01-15T01:30:15.01Z",      "changeDate": "2023-01-15T01:30:15.01Z"    }  ]}

Was this page helpful?