Docs
Live demo
GET/api/v2/policies
access:readAPI token

Retrieve a paginated list of policies (access bindings) with optional filtering

  • temporary=true filters TTL rules, sort=expires orders soonest-expiring first, exclude_applications=true hides application sign-in rules.
  • id[] and subject_id[] take up to 100 IDs each. GET /policies/facets shares these filters.

Parameters

Query20 optional
cursorstringquery

Pagination cursor for next page

limitintegerquery

Maximum number of items to return (default: 20, max: 100)

subject_idstringquery

Filter by subject ID (UUID)

target_idstringquery

Filter by target ID (UUID)

target_id[]array of stringquery

Filter by any of these target IDs (UUIDs), in addition to target_id

id[]array of string · uuidquery

Only the rules with these IDs (UUIDs), up to 100. Names rules by ID in one request

max items 100
subject_id[]array of string · uuidquery

Only the rules of these subjects (person, group or service account IDs), up to 100

max items 100
searchstringquery

Search subject display names, target names and rule IDs. Every word must match one of them (case-insensitive)

max length 200
last_apply_status[]array of stringquery

Filter by last apply statuses, as returned in last_apply_status

subject_kind[]array of stringquery

Filter by subject kinds (user, group, service)

latest_plan_risk[]array of stringquery

Filter by latest plan risks (critical, high, medium, low)

binding[]array of stringquery

Filter by binding kind: direct keeps the rules of the list, inherited keeps none of them (inherited bindings are not list rows. They appear in effective access)

directinherited
engine[]array of stringquery

Filter by target engines (postgres, kubernetes, mysql, clickhouse, mongodb)

templatestringquery

Filter by the name of the access template the rule was made from

max length 200
temporarybooleanquery

When true, only rules with a TTL (I17), the ones that end by themselves at their expires_at

exclude_applicationsbooleanquery

When true, rules that only grant sign-in to applications (on the application engine or with app:// resources only) are left out

problems_firstbooleanquery

When true, rules whose last apply failed or needs a look come before the rest, ahead of the sort

sortstringquery

Sort column. Giving any of the filter, search, sort or group parameters switches the list to the filtered ordering. Without them the list keeps its historical newest-first order. Empty sort values come last, except risk, where rules without a plan rank before critical when ascending

subjecttargetapplyriskversionappliedexpires
sort_directionstringquery

Sort direction. Defaults to the column direction (version and applied descend)

ascdesc
group_bystringquery

Order rows by this grouping key first, so a client can cut the page stream into groups

applytargetsubjectriskengine

Responses

200

OK

ListPoliciesResponse · 4 fields
has_morebooleanrequired

True when another page follows. The list ends when it is false.

itemsarray of PolicyResponserequired
46 fields
expires_atstring · date-time

When Principal removes this rule with a TTL (I17). Absent for a rule without one.

expiry_apply_not_startedboolean

Set only in the response to PUT /policies/{id} that changes the expiry: Principal saved the new expiry but could not start the Apply that brings it to the account on the database.

last_apply_failureOperationFailureResponse

Safe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.

8 fields
codestring (JobFailureCode)required

Closed registry of asynchronous operation failure causes, independent of HTTP problem codes.

ACCESS_PROFILE_STALEAMBIGUOUS_TARGET_OUTCOMEAPPLY_INTERRUPTEDAUTHENTICATION_FAILEDCLICKHOUSE_REPLICAS_OUT_OF_SYNCCLICKHOUSE_USER_NAME_RESERVEDCONNECTION_FAILEDCONNECTION_REFUSEDCONNECTION_TIMEOUTCONNECTOR_CREDENTIALS_MISSINGCONNECTOR_PAUSEDCONNECTOR_SOURCE_CHANGEDCONNECTOR_TYPE_UNAVAILABLECONSTRAINT_VIOLATIONCREDENTIAL_EXPIREDCREDENTIAL_NOT_FOUNDDATABASE_NOT_FOUNDDRIFT_BINDING_NOT_FOUNDDRIFT_DEFAULT_INHERITED_SKIPPEDDRIFT_NO_EXECUTABLE_DIFFDRIFT_PARTIAL_APPLYDRIFT_PLAN_GENERATION_FAILEDDRIFT_RESOURCE_MISMATCHDRIFT_RULE_DELETINGDRIFT_RUN_OUTDATEDDRIFT_SCOPE_MISMATCHGROUP_EXPANSION_LIMIT_EXCEEDEDHANDLER_NOT_FOUNDK8S_CHANGE_REJECTEDK8S_CLUSTER_UNREACHABLEK8S_NAMESPACE_FORBIDDENK8S_NAMESPACE_NOT_FOUNDK8S_RBAC_FORBIDDENKUBERNETES_MEMBER_CREDENTIALS_PENDINGKUBERNETES_SERVICE_ACCOUNT_KUBECONFIG_NOT_ISSUEDMARIADB_TRUNCATE_UNSUPPORTEDMARIADB_USAGE_UNSUPPORTEDMARIADB_GRANTS_AMBIGUOUSMUTATION_LOCKEDMYSQL_MANAGEMENT_PRIVILEGES_MISSING
34 more values
NOT_FOUNDOPERATION_BACKOFFOPERATION_CANCELLEDOPERATION_TIMEOUTOWNED_OBJECTS_DECISION_REQUIREDPERMISSION_DENIEDPLAN_APPLY_ARTIFACT_INVALIDPLAN_APPLY_ORPHANED_LOCKPLAN_APPLY_ROLLBACK_BASELINE_INVALIDPLAN_APPLY_RULE_CHANGEDPLAN_APPLY_TARGET_STATE_CHANGEDPLAN_APPLY_ACCESS_IMPACT_CHANGEDPOSTGRES_FUTURE_OBJECT_CREATORS_MISSINGPOSTGRES_GRANT_AUTHORITY_MISSINGPOSTGRES_MANAGEMENT_PRIVILEGES_MISSINGPOSTGRES_ROLE_ATTRIBUTE_UNSUPPORTEDPOSTGRES_ROLE_NAME_RESERVEDPOSTGRES_TLS_FILE_NOT_ALLOWEDPROVIDER_REQUEST_FAILEDRATE_LIMITEDROLE_EXISTSROLE_NOT_FOUNDROTATION_CHECK_REQUIREDSECRET_STORE_UNAVAILABLESERIALIZATION_ERRORTARGET_ACCOUNT_IDENTITY_MISMATCHTARGET_ACCOUNT_IDENTITY_UNVERIFIEDTARGET_ACCOUNT_IMPORT_PENDINGTARGET_ACCOUNT_PRINCIPAL_LOGINTARGET_ACCOUNT_TAKENTARGET_CONNECTION_MISSINGTARGET_REPAIR_REQUIREDUNKNOWN_ERRORVALIDATION_FAILED
titlestring

Short name of the failure from the same registry, for lists and queues where the explanation is too long. Absent on failures saved before the field existed.

max length 32
explanationstringrequired
recommended_actionstringrequired
retryablebooleanrequired

Whether the failed attempt was eligible for an automatic retry under the actual queue policy.

phasestring

Known operation phase at failure, when available.

resolution_codestring

Stable code of the action that can resolve this failure, the same vocabulary as a problem's resolution.code, for example upstream.check_connection. Absent when no single action does. A screen that offers the action shows it next to the failure, otherwise it shows recommended_action.

max length 128 · pattern ^[a-z][a-z0-9_-]*(\.[a-z0-9_-]+)*$
cluster_answerstring

The Kubernetes cluster's own answer to a change its admission policy or webhook refused: the policy or webhook name and its message. Only a step failure with code K8S_CHANGE_REJECTED carries it, as plain text without control characters, cut to 500 characters. The cluster administrator writes it, not Principal. Given only to callers with access:read in the rule's organization. Absent for runs saved before the field existed.

max length 500

Safe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.

8 fields
codestring (JobFailureCode)required

Closed registry of asynchronous operation failure causes, independent of HTTP problem codes.

ACCESS_PROFILE_STALEAMBIGUOUS_TARGET_OUTCOMEAPPLY_INTERRUPTEDAUTHENTICATION_FAILEDCLICKHOUSE_REPLICAS_OUT_OF_SYNCCLICKHOUSE_USER_NAME_RESERVEDCONNECTION_FAILEDCONNECTION_REFUSEDCONNECTION_TIMEOUTCONNECTOR_CREDENTIALS_MISSINGCONNECTOR_PAUSEDCONNECTOR_SOURCE_CHANGEDCONNECTOR_TYPE_UNAVAILABLECONSTRAINT_VIOLATIONCREDENTIAL_EXPIREDCREDENTIAL_NOT_FOUNDDATABASE_NOT_FOUNDDRIFT_BINDING_NOT_FOUNDDRIFT_DEFAULT_INHERITED_SKIPPEDDRIFT_NO_EXECUTABLE_DIFFDRIFT_PARTIAL_APPLYDRIFT_PLAN_GENERATION_FAILEDDRIFT_RESOURCE_MISMATCHDRIFT_RULE_DELETINGDRIFT_RUN_OUTDATEDDRIFT_SCOPE_MISMATCHGROUP_EXPANSION_LIMIT_EXCEEDEDHANDLER_NOT_FOUNDK8S_CHANGE_REJECTEDK8S_CLUSTER_UNREACHABLEK8S_NAMESPACE_FORBIDDENK8S_NAMESPACE_NOT_FOUNDK8S_RBAC_FORBIDDENKUBERNETES_MEMBER_CREDENTIALS_PENDINGKUBERNETES_SERVICE_ACCOUNT_KUBECONFIG_NOT_ISSUEDMARIADB_TRUNCATE_UNSUPPORTEDMARIADB_USAGE_UNSUPPORTEDMARIADB_GRANTS_AMBIGUOUSMUTATION_LOCKEDMYSQL_MANAGEMENT_PRIVILEGES_MISSING
34 more values
NOT_FOUNDOPERATION_BACKOFFOPERATION_CANCELLEDOPERATION_TIMEOUTOWNED_OBJECTS_DECISION_REQUIREDPERMISSION_DENIEDPLAN_APPLY_ARTIFACT_INVALIDPLAN_APPLY_ORPHANED_LOCKPLAN_APPLY_ROLLBACK_BASELINE_INVALIDPLAN_APPLY_RULE_CHANGEDPLAN_APPLY_TARGET_STATE_CHANGEDPLAN_APPLY_ACCESS_IMPACT_CHANGEDPOSTGRES_FUTURE_OBJECT_CREATORS_MISSINGPOSTGRES_GRANT_AUTHORITY_MISSINGPOSTGRES_MANAGEMENT_PRIVILEGES_MISSINGPOSTGRES_ROLE_ATTRIBUTE_UNSUPPORTEDPOSTGRES_ROLE_NAME_RESERVEDPOSTGRES_TLS_FILE_NOT_ALLOWEDPROVIDER_REQUEST_FAILEDRATE_LIMITEDROLE_EXISTSROLE_NOT_FOUNDROTATION_CHECK_REQUIREDSECRET_STORE_UNAVAILABLESERIALIZATION_ERRORTARGET_ACCOUNT_IDENTITY_MISMATCHTARGET_ACCOUNT_IDENTITY_UNVERIFIEDTARGET_ACCOUNT_IMPORT_PENDINGTARGET_ACCOUNT_PRINCIPAL_LOGINTARGET_ACCOUNT_TAKENTARGET_CONNECTION_MISSINGTARGET_REPAIR_REQUIREDUNKNOWN_ERRORVALIDATION_FAILED
titlestring

Short name of the failure from the same registry, for lists and queues where the explanation is too long. Absent on failures saved before the field existed.

max length 32
explanationstringrequired
recommended_actionstringrequired
retryablebooleanrequired

Whether the failed attempt was eligible for an automatic retry under the actual queue policy.

phasestring

Known operation phase at failure, when available.

resolution_codestring

Stable code of the action that can resolve this failure, the same vocabulary as a problem's resolution.code, for example upstream.check_connection. Absent when no single action does. A screen that offers the action shows it next to the failure, otherwise it shows recommended_action.

max length 128 · pattern ^[a-z][a-z0-9_-]*(\.[a-z0-9_-]+)*$
cluster_answerstring

The Kubernetes cluster's own answer to a change its admission policy or webhook refused: the policy or webhook name and its message. Only a step failure with code K8S_CHANGE_REJECTED carries it, as plain text without control characters, cut to 500 characters. The cluster administrator writes it, not Principal. Given only to callers with access:read in the rule's organization. Absent for runs saved before the field existed.

max length 500
applied_atstring
changes_not_appliedbooleanrequired

Saved changes that the last successful apply did not materialize. True when the rule state recorded by that apply (effective permissions, placement, template versions, layout and materialization switches of the snapshot it applied) differs from the current rule. Rules applied before the state was recorded fall back to updated_at later than applied_at plus 5 seconds after a success or partial success. Always false for per-member copies of a group rule. Renames, apply status writes and other bookkeeping never set it.

cleanup_last_errorstring
cleanup_statusstring
delete_requestedcleanup_runningcleanup_failedcleanup_completed
cleanup_task_idstring
created_atstring
created_bystring
display_namestringrequired

Canonical human name of the rule, the one every screen and message uses: the rule's own name. Else "{Template} for {Subject}" for a template rule. Else "Access for {Subject} on {Target}". A rule inherited from a group gets the group rule's name. Missing subject or target names are left out. Machine-generated names and IDs are never used.

descriptionstring

What the access is for, from metadata.description of the rule. Absent when the rule has none.

idstring
inherited_from_group_display_namestring
inherited_from_group_external_idstring

Identifier of the group the access came through in its source, as the connector group mapping sets it. With the default mapping it is the full path for GitLab and GitHub groups (acme/platform/backend) and the address for Google groups. Empty for groups not linked to a connector and for callers without identities:read.

inherited_from_group_idstring

Group inheritance fields

include_nested_groupsboolean

Whether this group rule includes members of nested groups.

is_inherited_bindingboolean
target_account_link_idstring

Set on the rule of an adopted target account. Assigning a template to the identity adds it to the identity's rule without a target account link, never to this rule.

last_apply_statusstring
successpartial_successfailed
latest_plan_riskstring

Risk level of the latest plan (low, medium, high, critical)

latest_plan_atstring

When the latest plan was created

latest_plan_idstring

ID of the most recent plan for this policy

materialization_modestring
kubernetes_user_rbackubernetes_group_rbackubernetes_service_account_rbacgroup_roleapplication_group
group_access_modestring

Access mode of a group rule on a PostgreSQL, MariaDB or ClickHouse target, and of the member rows it keeps. member_grants copies the rule to every member's account, group_role keeps it in a role of the group that members are granted. Absent on other rules.

member_grantsgroup_role
group_role_namestring

The role a group rule in the group_role mode keeps on the target. Absent otherwise.

kubernetes_namespacesarray of string

Namespaces contributed by this policy to shared Kubernetes RBAC profiles.

kubernetes_rbac_layoutstring

Effective server-owned Kubernetes RBAC object layout. Every new rule is materialized as unified_v1. The other values only appear on policies created before that layout and disappear as those are rematerialized. A policy still on the pre-stage-3 Role-per-namespace layout carries no value at all.

unified_v1shared_clusterrole_v1shared_profile_v1
metadatamap of string → any
organization_idstring
organization_namestring
rulesarray of PolicyRuleResponse
3 fields
permissionsarray of string
resourcesarray of string
originstring (AccessOrigin)

Where a row of a rule came from: written in the rule, materialized from its template, or imported from the live account at adoption or by the one-off import after an upgrade. An imported row is part of the desired state like any other row.

ruletemplateimported
membershipsarray of PolicyMembershipResponse

Memberships of the rule's account in other roles (PostgreSQL). The rule asks for them like for its grants: an apply grants a missing one back.

5 fields
rolestringrequired
admin_optionbooleanrequired
inheritboolean
setboolean
originstring (AccessOrigin)required

Where a row of a rule came from: written in the rule, materialized from its template, or imported from the live account at adoption or by the one-off import after an upgrade. An imported row is part of the desired state like any other row.

ruletemplateimported
unobserved_accessarray of string

Kinds of access the engine of the target does not read, such as column privileges on PostgreSQL. An empty drift says nothing about them.

future_objects_named_rowFutureObjectsNamedRowResponse

The first row of a PostgreSQL rule or template that names its objects by name or by a name mask while Future objects are on. Future objects reach only a row on every object of its kind in a schema, so the switch reaches none of these objects. Only a rule or template saved before Principal refused such a save carries it, and its next save is refused until Future objects are off or the row covers every object of its kind. A rule carries it in every read. A template only in GET /access-templates/{name} and the version read.

4 fields
objectsstringrequired

The kind of objects of the row, in the plural.

tablessequencesfunctionstypesobjects
databasestring

The database the row names. Absent when the row names none, and always for a template.

schemastring

The schema the row names. Absent when the row names none.

namestringrequired

The object name or name mask of the row.

subject_display_namestring

Subject info fields (enriched from Identity)

subject_external_idstring

Identifier of a group subject in its source, as the connector group mapping sets it. With the default mapping it is the full path for GitLab and GitHub groups (acme/platform/backend) and the address for Google groups. Empty for groups not linked to a connector, for people and service accounts, and for callers without identities:read.

subject_idstring
subject_kindstring

"user", "group", "service"

target_idstring
target_namestring

Name of the target. Absent when the target could not be read.

target_kindstring

Kind of the target, such as postgres or kubernetes. Absent when the target could not be read.

updated_atstring
versioninteger
warningsarray of string
next_cursorstring

Opaque cursor of the next page, present only when has_more is true. Send it unchanged as the cursor query parameter with the same filters.

totalinteger

Full number of items that match the request, present only when the list counts them. It is never the size of the page.

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

↑ ↓ to moveEnter to openEsc to close