Docs
Live demo
GET/api/v2/targets/{id}/clickhouse-users
targets:readAPI token

Retrieve discovered ClickHouse SQL users and normalized direct/effective grants. With refresh=true an organization admin starts discovery as POST /targets/{id}/discover does.

Parameters

Path and query1 required of 2
idstringpathrequired

Target ID (UUID)

refreshbooleanquery

Start discovery of the target. Organization admins only, a viewer gets 403

Responses

200

OK

ListClickHouseUsersResponse · 4 fields
target_idstringrequired
usersarray of ClickHouseUserResponserequired
13 fields
adoptablebooleanrequired

True when Principal can take the account under management. Adoption refuses the rest. Whether it is already managed is in principal.ownership_state.

user_namestringrequired
storage_namestringrequired
auth_typesarray of stringrequired
account_audiencestringrequired
humansystem
system_reasonstring
manageabilitystringrequired
principal_managedadoptableconfig_managedsystem
role_grantsarray of ClickHouseRoleGrantResponserequired
4 fields
role_namestringrequired
role_patharray of string
is_defaultbooleanrequired
with_admin_optionbooleanrequired
direct_grantsarray of ClickHouseGrantResponserequired
11 fields
sourcestringrequired
directrole
source_rolestring
role_patharray of string
privilegestringrequired
databasestring
tablestring
columnsarray of string
is_partial_revokebooleanrequired
grant_optionbooleanrequired
is_wildcardbooleanrequired
shape_unverifiedboolean

The grant may be a wildcard that ClickHouse printed without its '*'. Discovery could not confirm it.

effective_grantsarray of ClickHouseGrantResponserequired
11 fields
sourcestringrequired
directrole
source_rolestring
role_patharray of string
privilegestringrequired
databasestring
tablestring
columnsarray of string
is_partial_revokebooleanrequired
grant_optionbooleanrequired
is_wildcardbooleanrequired
shape_unverifiedboolean

The grant may be a wildcard that ClickHouse printed without its '*'. Discovery could not confirm it.

discovered_atstringrequired
updated_atstringrequired
9 fields
ownership_statestringrequired
unmanagedprincipal_createdadoptedorphaned
credential_ownershipstring
externalprincipal_managedunknown
link_idstring
adopted_atstring

The rule that created a Principal-created account.

native_identity_statestring

Whether Principal recorded the account instance it created or adopted. Set only for PostgreSQL and MongoDB accounts Principal created or adopted. Principal removes the account, revokes its access or changes its password only when it is verified. Mismatch means the account was recreated outside Principal.

verifiedunverifiedmismatch
native_identity_sourcestring

How Principal recorded the account instance: created right after it created the account, adopted from discovery at adoption, or observed by the first discovery or apply that saw it.

createdadoptedobserved
metadataDiscoveryMetadatarequired
2 fields
as_ofstring

Timestamp of the discovery data

staleboolean

Whether the cache is considered stale

job_idstring
202

Discovery started (refresh=true by an organization admin)

409

With refresh=true only. Discovery of the target is paused after failed runs (code target.operation_backoff_active), or the target is being deleted (code cleanup_in_progress), or discovery already runs on this target or waits for its next attempt (code operation.already_running: details.existing_job_id and resources with relation running_operation name that job, details.started_at is when it was started, resolution.code operation.view_running opens it). Nothing was queued.

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

↑ ↓ to moveEnter to openEsc to close