Docs
Live demo
GET/api/v2/identities/{id}/credentials

Reveal the credentials Principal issued to an identity on every target: database passwords, kubeconfigs and connection strings. Every call that returns secrets is first recorded on the server as the audit event identity.credentials.reveal with the caller, the identity, the targets, the channel (console session or API token) and the client address, and it counts toward the caller's hourly reveal limit (dto.OrganizationPolicyResponse.credentials_read_limit_per_hour). A member reads their own credentials. An administrator reads anyone's. In a console session the caller confirms a second factor within the re-authentication window first (403, details.reason=mfa_reauth_required, then POST /auth/mfa/reauth). An administrator without a second factor set up does not get other people's credentials (403, details.reason=mfa_enrollment_required). An API token reads credentials only when it was issued with allow_credentials_read: the right given at issuance stands in for the second factor, so give it only to tokens that need it and keep their expiry short. With credentials_show_once on, a secret that was already shown comes back without its value, with reveal_available=false and an unavailable_reason, until it is rotated.

  • Audited before secrets return. If audit logging fails, returns 503 (details.reason=audit_log_unavailable), reveals nothing and skips the rate limit.
  • Members with user role read their own identity. Admins reading another identity need fresh MFA step-up via POST /auth/mfa/reauth (403, details.reason=mfa_reauth_required).
  • API tokens need allow_credentials_read. Exceeding the hourly limit returns 429 with details.retry_at.

Parameters

Path1 required of 1
idstringpathrequired

Identity ID (UUID)

Responses

200

OK

ListCredentialsResponse · 2 fields
19 fields
account_display_namestring
connectionany

PostgreSQLConnectionDetails, MySQLConnectionDetails, ClickHouseConnectionDetails, MongoDBConnectionDetails, or KubernetesConnectionDetails. Empty for SSH targets: POST /ssh/certificates returns the hosts with the certificate.

credential_ownershipstring
externalprincipal_managedunknown
ownership_statestring
unmanagedprincipal_createdadoptedorphaned
reveal_availableboolean
rotate_availableboolean
rotate_requires_confirmationboolean
rotation_confirmation_kindstring
unavailable_reasonstring

Why Principal can't give this credential now, safe to show. Set only then. The item carries no secret and can't be revealed. Whether it can be rotated is rotate_available: rotating a damaged kubeconfig of a target account issues a working one.

unavailable_fixstring

The action that gives a working credential again, set with unavailable_reason when one does: rotate means Rotate issues a new credential (rotate_available is then true). unavailable_reason names only the cause then. The screen names the action for the viewer.

rotate
credentialsany

UsernamePasswordCredentials, KubeconfigCredentials or, for SSH targets, {"type": "ssh_certificate"}: the identity signs in with a certificate from POST /ssh/certificates, there is no secret to reveal or rotate. While rotation_state is not_confirmed, UsernamePasswordCredentials also carries unconfirmed_password, the new password of the cut-off change: the target accepts either it or password.

rotation_statestring

not_confirmed while a password change cut off after it was sent waits for a check: Principal keeps both passwords and doesn't know which one the target accepts. POST /identities/{id}/credentials/rotation-check settles it. A Rotate finishes the change with the same new password.

not_confirmed
rotation_started_atstring · date-time

When the unconfirmed password change was sent.

expires_atstring · date-time

The temporary account of a rule with a TTL (I17) works until this moment. Principal removes it then. Absent for a permanent account.

secret_shown_atstring · date-time

When the current secret of this account was first revealed. Two answers with the same moment carry the same secret, so a client keeps the value it already holds when a later answer hides it as shown once.

target_idstring
target_account_link_idstring
target_kindstring (entity.TargetKind)

postgresql, mysql, clickhouse, mongodb, kubernetes. Absent, like target_name, when the target can't be read. The item then carries unavailable_reason.

postgreskubernetesmysqlclickhousemongodbapplicationssh
target_namestring
totalinteger
403

Forbidden: the caller is not the identity and not an administrator (details.reason=operation_not_permitted), the session has no fresh second-factor confirmation (details.reason=mfa_reauth_required), the administrator has no second factor set up (details.reason=mfa_enrollment_required), or the request uses an API token issued without allow_credentials_read (code auth.api_token_not_allowed, details.reason=api_token_credentials_read_not_allowed).

429

Too many requests: the caller reached the hourly reveal limit of the organization (details.reason=credential_read_limit_exceeded, details.limit, details.retry_at. Retry-After names the seconds to wait), or the request rate limit (request.rate_limited).

503

Service Unavailable: Principal couldn't record the reveal in the audit log, so it returns no secrets (details.reason=audit_log_unavailable). Retry-After names the seconds to wait.

Common errors: 400 401 404 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close