Docs
Live demo
POST/api/v2/policies/{id}/plan
access:applyAPI token

Generate a Terraform-style execution plan showing operations needed to apply the policy and store it as a saved plan. exact_apply_supported tells whether POST /plans/{id}/apply can execute this plan exactly. When it is false, apply the current state with POST /policies/{id}/apply.

Parameters

Path1 required of 1
idstringpathrequired

Policy ID (UUID)

Responses

200

OK

SavedPlanResponse · 13 fields
changesarray of OperationChange
5 fields
actionstring

create, update, delete, no-op

descriptionstring

Human-readable change description

resource_typestring

role, grant, policy, k8s-resource

sqlstring

SQL statement (if applicable)

targetstring

Target resource (role name, database, etc.)

created_atstring
dry_runboolean

Always true for plan preview

expires_atstring
operationsarray of OperationChange
5 fields
actionstring

create, update, delete, no-op

descriptionstring

Human-readable change description

resource_typestring

role, grant, policy, k8s-resource

sqlstring

SQL statement (if applicable)

targetstring

Target resource (role name, database, etc.)

plan_idstring

Legacy fields for /:id/plan endpoint (old flow)

preview_idstring

Fields for plan-preview endpoint (new flow)

resource_diffsarray of ResourceDiff
5 fields
actionstring
addressstring
aftermap of string → any
beforemap of string → any
resource_typestring
2 fields
by_actionmap of string → integer

{"create": 5, "update": 2, "delete": 1}

total_changesinteger
warningsarray of string
access_impactAccessImpact

Effect of successful execution on inspected existing MariaDB databases and global privileges. Unknown assessments block confirmation. Sessions describes cached privilege protection over every execution prefix. Removed patterns change grant coverage for future databases, separately from the enumerated existing databases. Runtime failures require a fresh access check.

7 fields
statusstringrequired
preservedreducedunknown
sessionsstringrequired
preservedclosedunknown
reasonstring
databasesarray of stringrequired
tablesarray of stringrequired
global_privilegesarray of stringrequired
removed_patternsarray of stringrequired
exact_apply_supportedbooleanrequired

True when POST /plans/{id}/apply executes this saved plan exactly as stored. False when the apply refuses exact execution, for a group policy applied per member, a policy on the legacy shared Kubernetes RBAC profile or a target engine that stored no execution artifact. Apply the current state of the policy with POST /policies/{id}/apply instead.

member_policy_removalsarray of MemberPolicyRemovalDTOrequired

Per-member policies the apply of this plan deletes after it binds a group itself (Kubernetes direct group RBAC), with the access each deletion revokes. The exact apply of this plan deletes no other member policy. Empty when the apply removes none.

4 fields
member_display_namestringrequired

Name of the member. Empty when the member is unknown in the organization.

member_idstring · uuidrequired

Identity the member policy grants access to.

policy_idstring · uuidrequired

The per-member policy the apply deletes.

rulesarray of PolicyRuleResponserequired

The access the deletion revokes from the member.

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
409

Conflict - the policy is in cleanup and read-only. Details.cleanup_task_id names the task. Or the group role name of a group rule is taken by a role Principal didn't create (code policy.group_role_taken, details.role names the role, detail and resolution come from the failure reason group_role_taken of ROLE_EXISTS)

422

Unprocessable Entity - the rule cannot be executed or planned on the target as written, for example a privilege on an object level that does not take it, Kubernetes guards that leave nothing to grant, or future objects with no known creators. Detail and field_errors name the fix Also when Principal doesn't manage the target of the rule or template (before v7.3 that answer was 403 authorization.denied).

501

Not Implemented - a rule uses a privilege the target engine does not support

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

↑ ↓ to moveEnter to openEsc to close