KongPrincipal

Get a Principal

Changed on

Retrieves detailed information about a specific principal by its ID.

get/v2/directories/{directoryId}/principals/{principalId}

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Path parameters

directoryId, string uuid required

ID of the directory

principalId, string uuid required

Unique identifier of the principal (UUID format)

Response

Response containing a single principal object

KongPrincipal required

A principal represents an authenticated identity within a directory. Principals can be associated with API keys and inherit metadata from their parent directory.

id, string uuid required

Contains a unique identifier used for this resource.

display_name, string

Human-readable name of the principal.

description, string required

Optional description providing additional context about the principal's purpose or role.

type, 'agent' | 'user' nullable

Classifies the kind of principal. agent is a deployed AI agent, user is a human in the organization, and null means not classified. Immutable after creation: on update or replace, omit it or send the current value.

metadata, KongIdentityMetadata nullable required

A map of metadata key-value pairs associated with this entity. This metadata is passed to the data plane to enrich the execution context. During authentication, metadata is inherited and overridden in a hierarchical manner: Directory metadata is inherited by Principals, which is then inherited and overridden by Credentials.

labels, Labels required

Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

created_at, string date-time required

An ISO-8601 timestamp representation of entity creation date.

updated_at, string date-time required

An ISO-8601 timestamp representation of entity update date.

managed_by, ManagedBy required

Stores information about what manages this entity, such as the tool or system responsible for its lifecycle (for example, terraform).

Keys must be 1–63 characters long, start and end with an alphanumeric character, and may contain dashes (-), underscores (_), and dots (.). Values must be 1–127 characters long and must not be empty. Keys and values must not contain spaces or control characters.

provisioned_by, 'konnect_user' | 'developer_portal' | 'trusted_idp' | 'imported' required

Identifies the actor that provisioned this principal. Defaults to konnect_user for principals created directly by a user; other values identify a service that provisioned the principal on a user's behalf (for example, developer_portal or trusted_idp).

active, boolean required

Whether the principal is active. Inactive principals are treated as nonexistent when authenticating. Defaults to true on create; omitting it on update or replace keeps the current value. Setting it to false sets provisioned_by to konnect_user. Principals provisioned by the developer portal cannot be deactivated.

groups, string[]

List of IDs of the groups this principal is a member of.

Example response

{
  "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
  "labels": {
    "env": "test"
  },
  "created_at": "2022-11-04T20:10:06.927Z",
  "updated_at": "2022-11-04T20:10:06.927Z",
  "managed_by": {
    "owner": "terraform"
  },
  "active": true
}

Changes