Preview Policies Rank Change

POST {{cb_url}}/policy-assignment/v1/orgs/{{cb_org_key}}/policies/preview

Preview changes in the ranking of policies. Use this API call to see how a change in the rank of a policy or policies will affect assets.
Rank policies in order of importance. When an asset is assigned more than one policy, the highest-ranking policy takes precedence.

To view order of policies based on their ranking, use the Get Policies Order by Rank API call.

To make the actual change in the rank of a policy or policies, use the Update Policy Ranks API call.

RBAC Permissions Required

Permission (.notation name)Operation(s)
org.policiesREAD

See Documentation

Request Schema

{
  "policies": {
    "id": <integer>,
    "position": <integer>
  }
}

Request Body

{"policies"=>[{"id"=>465946, "position"=>3}]}

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{&quot;preview&quot;:[{&quot;current_policy&quot;:{&quot;id&quot;:465946,&quot;position&quot;:1},&quot;new_policy&quot;:{&quot;id&quot;:20578754,&quot;position&quot;:2},&quot;asset_count&quot;:18,&quot;asset_query&quot;:&quot;(-_exists_:ag_agg_key_manual AND ag_agg_key_dynamic:dde4e64893bbec9278b2beac4d6437c7f56114ffe0f40b5947e1c2e33e22829f AND policy_override:false) OR (ag_agg_key_manual:2c7190a37a11f4af3635e77f2d7ee9f61f659f7c49afbb663435f7846c6ec0c7 AND ag_agg_key_dynamic:dde4e64893bbec9278b2beac4d6437c7f56114ffe0f40b5947e1c2e33e22829f AND policy_override:false)&quot;}]}