Skip to main content
PATCH
Update an organization rule
Changes only the fields you send. OneCLI validates the merged result, so an invalid mix of action and modifiers is rejected. The change applies to every workspace right away. Related guide: Rules: control what agents can do. Partial. The action-versus-modifier laws are re-checked against the merged rule.
Availability: Cloud · Community (self-hosted) · Enterprise (self-hosted)

Authorizations

Authorization
string
header
required

A workspace API key (oc_…) or organization API key (oc_org_…). Workspace-scoped endpoints called with an organization key also need X-Workspace-Id.

Path Parameters

ruleId
string
required

Body

application/json

Every field optional (at least one required); nullable fields accept an explicit null to clear.

name
string
description
string | null
enabled
boolean
action
enum<string>
Available options:
allow,
block
rateLimit
integer | null
rateLimitWindow
string | null
requireApproval
boolean
conditions
unknown
identities
object[]
targets
object[]

Response

The rule

A policy-engine rule. Every write is enforced immediately; the draft/published split survives only for older clients. Published row ids regenerate on every publish; logicalId is the identity stable across statuses and generations.

id
string
scope
enum<string>
Available options:
organization,
workspace
status
enum<string>
Available options:
draft,
published
generation
integer

0 for the draft working copy; the snapshot number for published rows.

priority
integer

First-match order (lower evaluates first).

enabled
boolean
isDefault
boolean

True on the scope's terminal Default Rule.

logicalId
string

Generation-stable identity; compare rules across draft/published by this, never by id.

source
string

custom (user-owned, editable), default (the Default Rule), or system-managed rows: blocklist (compiled from app blocklists) and, at workspace scope, grant (compiled from agent grants; managed through the Grants endpoints, never edited as rules).

name
string
description
string | null
action
enum<string>
Available options:
allow,
block
rateLimit
integer | null
rateLimitWindow
enum<string> | null
Available options:
minute,
hour,
day,
null
requireApproval
boolean
conditions
any | null

A conditions array, a session-policy object ({repositories} / {folders} / {driveFolders}), or null.

identities
object[]
targets
object[]
createdAt
string<date-time>