---
title: "Update an identity"
method: PATCH
path: "/v2/directories/{directoryId}/principals/{principalId}/identities/{identityId}"
tags: ["KongPrincipalIdentity"]
---

# Update an identity

`PATCH /v2/directories/{directoryId}/principals/{principalId}/identities/{identityId}`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v2/directories/{directoryId}/principals/{principalId}/identities/{identityId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Partially updates an existing principal identity by modifying only the provided fields.
Unspecified fields will retain their current values.

## Path parameters

- `directoryId` string, uuid, required
- `principalId` string, uuid, required
- `identityId` string, uuid, required

## Request body

- UpdatePrincipalIdentityBody: Request body for partially updating a principal identity. The identity type cannot be changed. All fields are optional; only the fields relevant to the existing identity type will be applied.
  - `issuer` string: The issuer URL. Applicable to oidc type identities.
  - `claim` object
    - `name` string
    - `value` string
  - `auth_server_id` string, uuid: The auth server ID. Applicable to auth_server_client type identities.
  - `client_id` string: The client ID. Applicable to auth_server_client type identities.
  - `control_plane_id` string: The control plane ID. Applicable to control_plane_consumer type identities.
  - `workspace_id` string: The workspace ID. Applicable to control_plane_consumer type identities.
  - `consumer_id` string: The consumer ID. Applicable to control_plane_consumer type identities.
  - `key` string: The key. Applicable to custom type identities.
  - `value` string: The value. Applicable to custom type identities.

## Response `200`

A principal identity

- union
  - KongPrincipalIdentityOIDCResponse
    - [`KongPrincipalIdentityResponseBase`](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4/schema?at=%2Fcomponents%2Fschemas%2FKongPrincipalIdentityResponseBase)
    - object
      - `type` 'oidc', required
      - `issuer` string, required
      - `claim` object, required
        - `name` string, required
        - `value` string, required
  - KongPrincipalIdentityAuthServerClientResponse
    - [`KongPrincipalIdentityResponseBase`](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4/schema?at=%2Fcomponents%2Fschemas%2FKongPrincipalIdentityResponseBase)
    - object
      - `type` 'auth_server_client', required
      - `auth_server_id` string, uuid, required
      - `client_id` string, required
  - KongPrincipalIdentityCPConsumerResponse
    - [`KongPrincipalIdentityResponseBase`](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4/schema?at=%2Fcomponents%2Fschemas%2FKongPrincipalIdentityResponseBase)
    - object
      - `type` 'control_plane_consumer', required
      - `control_plane_id` string, required
      - `consumer_id` string, required
      - `workspace_id` string
      - `control_plane_type` 'api_gateway' | 'ai_gateway', required: The kind of control plane the linked consumer was found in.
  - KongPrincipalIdentityCustomResponse
    - [`KongPrincipalIdentityResponseBase`](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4/schema?at=%2Fcomponents%2Fschemas%2FKongPrincipalIdentityResponseBase)
    - object
      - `type` 'custom', required
      - `key` string, required
      - `value` string, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict

## Changes

- **2026-11-16** `a209c8bfa7b7`: 8 info
  - the `type` response property const value `auth_server_client` was added for the status `200`
  - the `type` response property const value `control_plane_consumer` was added for the status `200`
  - the `type` response property const value `custom` was added for the status `200`
  - the `type` response property const value `oidc` was added for the status `200`
  - …4 more
- **2026-11-12** `d8bd04cfbaf7`: 8 breaking, 4 warning, 4 info
  - the `type` response property const value `auth_server_client` was removed for the status `200`
  - the `type` response property const value `control_plane_consumer` was removed for the status `200`
  - the `type` response property const value `custom` was removed for the status `200`
  - the `type` response property const value `oidc` was removed for the status `200`
  - …12 more
- **2026-11-05** `ff8439091e5f`: 8 info
  - the `type` response property const value `auth_server_client` was added for the status `200`
  - the `type` response property const value `control_plane_consumer` was added for the status `200`
  - the `type` response property const value `custom` was added for the status `200`
  - the `type` response property const value `oidc` was added for the status `200`
  - …4 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/kong/apis/konnect-api-go-sdk/changes/v2/directories/:directoryId/principals/:principalId/identities/:identityId/patch.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api-go-sdk.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api-go-sdk/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4?raw)
