v1
latestOpenAPI 3.1.02026-08-0413468163.9 KBv1-policies
Create Policy Endpoint
Create a new policy for an org. If assign_to_scope is provided, also create the assignment in the same request and roll the policy back if assignment fails — CLI settings set uses this to avoid orphan policies.
assign_to_scope shape: {"scope_type": "connectors"|"orgs"|"branches", "scope_id": "...", "priority": 100 (optional)}. Omit priority on branch_create_hook assignments to auto-append after existing hooks in the same scope using HOOK_PRIORITY_GAP.
post/v1/policies
Response
Successful Response
{"stackTrail":"paths:/v1/policies:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}