POST
/v1/mgmt/policies/rule/reorderAuthorization
Descope Project ID and Management Key AuthorizationBearer <token>
Project ID:Management Key as bearer token.
In: header
Request Body
application/json
ruleId?string
position?integer
Format
int32Move one policy rule to a 1-based position in the evaluation order; rules in between shift accordingly. Rules are evaluated first-match in this order.
curl -X POST "https://api.descope.com/v1/mgmt/policies/rule/reorder" \ -H "Content-Type: application/json" \ -d '{}'{ "policyRules": [ { "id": "string", "version": "string", "name": "string", "description": "string", "enabled": true, "ruleFamily": "string", "actionKinds": [ "string" ], "effect": "string", "principalType": "string", "principalSelector": [ "string" ], "resourceTargets": [ { "type": "string", "allOfType": true, "ids": [ "string" ] } ], "grants": [ { "scopes": [ "string" ], "allowedAudiences": [ "string" ], "allScopes": true } ], "conditions": [ { "key": "string", "operator": "string", "value": null } ], "cedarText": "string", "createdTime": 0, "modifiedTime": 0, "evaluationOrder": 0, "expireTime": 0 } ]}export interface Response {policyRules?: PolicyRule[]}export interface PolicyRule {id?: stringversion?: stringname?: stringdescription?: stringenabled?: booleanruleFamily?: stringactionKinds?: string[]effect?: stringprincipalType?: stringprincipalSelector?: string[]resourceTargets?: RuleResourceTarget[]grants?: PolicyRuleGrant[]/** * Structured conditions (AND-ed). operator is one of: equal, notEqual, * contains, notContains, in, notIn. value is a scalar (equal/contains) * or a list (in/notIn), carried as a JSON value. */conditions?: PolicyRuleCondition[]cedarText?: string/** * int32 epoch seconds: proto3 emits int64 as JSON string. See .claude/rules/proto-files.md. */createdTime?: numbermodifiedTime?: number/** * Server-assigned evaluation position (1-based); changes only via ReorderPolicyRule. */evaluationOrder?: number/** * Epoch seconds after which the rule is no longer evaluated; 0 means never. */expireTime?: number}/** * RuleResourceTarget identifies a Resource subset for an PolicyRule. A * target with AllOfType=true matches every resource of Type; otherwise the * IDs list enumerates the specific resources. */export interface RuleResourceTarget {type?: stringallOfType?: booleanids?: string[]}export interface PolicyRuleGrant {scopes?: string[]allowedAudiences?: string[]allScopes?: boolean}export interface PolicyRuleCondition {key?: stringoperator?: string/** * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. */value?: {[k: string]: unknown}} Was this helpful?