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

Retrieve discovered MongoDB users with their roles and inherited privileges. 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

ListMongoDBUsersResponse · 4 fields
target_idstringrequired
usersarray of MongoDBUserResponserequired
12 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
auth_sourcestringrequired

Authentication database of the user

mechanismsarray of stringrequired
account_audiencestringrequired
humansystem
system_reasonstring
manageabilitystringrequired
adoptableexternal_authsystem
rolesarray of MongoDBRoleResponserequired
3 fields
rolestringrequired
dbstringrequired
builtinbooleanrequired
privilegesarray of MongoDBPrivilegeResponserequired
5 fields
databasestringrequired
collectionstringrequired
clusterbooleanrequired
any_resourcebooleanrequired
actionsarray of stringrequired
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