Update a principal API key

Partially updates an existing API key’s metadata.
Note: The key secret cannot be modified after creation.

patch

Path Parameters

directoryIdstring(uuid)required

ID of the directory

principalIdstring(uuid)required

Unique identifier of the principal (UUID format)

apiKeyIdstring(uuid)required

Unique identifier of the API key (UUID format)

Body

application/json

Key to be updated

UpdatePrincipalKeyBody

Request body for updating an API key’s metadata

expires_atstring | null(date-time)

An ISO-8601 timestamp representation of entity expiration date.

Example:2022-11-04T20:10:06.927Z

Response

application/json

A Kong Principal Key

KongPrincipalKey

idstring(uuid)requiredread-only

Contains a unique identifier used for this resource.

Example:5f9fd312-a987-4628-b4c5-bb4f4fddd5f7

created_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity creation date.

Example:2022-11-04T20:10:06.927Z

updated_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity update date.

Example:2022-11-04T20:10:06.927Z

expires_atstring | null(date-time)required

An ISO-8601 timestamp representation of entity expiration date.

Example:2022-11-04T20:10:06.927Z

patch/directories/{directoryId}/principals/{principalId}/api-keys/{apiKeyId}

Body

{}
 
application/json

Get a principal API key

Retrieves detailed information about a specific API key.
Note: The key secret is not returned; it is only available when the key is first created.

get

Path Parameters

directoryIdstring(uuid)required

ID of the directory

principalIdstring(uuid)required

Unique identifier of the principal (UUID format)

apiKeyIdstring(uuid)required

Unique identifier of the API key (UUID format)

Response

application/json

A Kong Principal Key

KongPrincipalKey

idstring(uuid)requiredread-only

Contains a unique identifier used for this resource.

Example:5f9fd312-a987-4628-b4c5-bb4f4fddd5f7

created_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity creation date.

Example:2022-11-04T20:10:06.927Z

updated_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity update date.

Example:2022-11-04T20:10:06.927Z

expires_atstring | null(date-time)required

An ISO-8601 timestamp representation of entity expiration date.

Example:2022-11-04T20:10:06.927Z

get/directories/{directoryId}/principals/{principalId}/api-keys/{apiKeyId}
 
application/json

Delete an API key

Permanently deletes an API key, immediately revoking its access.
This operation cannot be undone.

delete

Path Parameters

directoryIdstring(uuid)required

ID of the directory

principalIdstring(uuid)required

Unique identifier of the principal (UUID format)

apiKeyIdstring(uuid)required

Unique identifier of the API key (UUID format)

Response

Success

delete/directories/{directoryId}/principals/{principalId}/api-keys/{apiKeyId}
 

KongPrincipalIdentity

Identities represent external authentication associations for a principal. Each identity links a principal
to an external system such as an OIDC provider, an auth server client, a control plane consumer, or a custom identifier.

List all identities for a principal

Retrieves a paginated list of all identities associated with the specified principal.

get

Query Parameters

page[size]integer

The maximum number of items to include per page. The last page of a collection may include fewer items.

Example:10

page[before]string

Request the next page of data, starting with the item before this parameter.

Example:ewogICJpZCI6ICJoZWxsbyB3b3JsZCIKfQ

page[after]string

Request the next page of data, starting with the item after this parameter.

Example:ewogICJpZCI6ICJoZWxsbyB3b3JsZCIKfQ

Path Parameters

directoryIdstring(uuid)required

ID of the directory

principalIdstring(uuid)required

Unique identifier of the principal (UUID format)

Response

application/json

List of principal identities

ListKongPrincipalIdentities

metaobjectrequired
Show Child Parameters
dataOne Of
arrayrequired
KongPrincipalIdentityOIDCResponseobject
Show Child Parameters
get/directories/{directoryId}/principals/{principalId}/identities
 
application/json