Skip to content

Read the effective rule stack (console plane)

GET
/v1/admin/orgs/{org_id}/projects/{project_id}/rules

Read the §7 precedence-ordered effective writing-rule stack for the resolved org/project (and optional category), applied SERVER-SIDE (deterministic, NO LLM). The agent-plane read (GET /v1/rules) is AgentKey-only, so the console reads the SAME ordered list here (Clerk session) for its rules panel.

org_id
required
string
project_id
required
string
category_id
string

Category id (cat_…). Empty returns ONLY the house-style/general layer.

scope
string
Allowed values: general category

Narrow to one layer (general | category). Default returns both.

Ok

The ORDERED active rule set (the §7 precedence ladder applied SERVER-SIDE, capped). Category rules precede general/house-style rules; within each, highest precedence first. The agent reconciles the list semantically (NO LLM on our side).

object
items
required
Array<object>

A learned writing rule (rule_…) in the Review Loop (D2/D11). House-style/ general (scope=‘general’, applies across all categories) or category-scoped. Append-only by supersession: an edit is a new rev (same lineage_id) with the prior flipped to superseded. Read by the agent at compose/redraft time via the ordered get_rules ladder; we never apply it. Opaque ids only (D10).

object
id
required

Opaque rule id (rule_…).

string
rule_layer

Ownership layer (org/project model). org = house-style inherited by every project in the org; project = layered on top (the agent-plane default). Project/per-agent rules outrank broader org rules in the ordered get_rules ladder.

string
Allowed values: org project
org_id

The org this rule belongs to.

string
project_id

The project this rule belongs to; empty for an org-layer rule.

string
lineage_id
required

Stable lineage handle across versions (rln_…).

string
rev
required
integer
scope
required

General = house-style (D2).

string
Allowed values: general category
category_id

Set iff scope=category (cat_…).

string
scope_agent_id

Set for a per-agent override; empty = all org agents.

string
rule_text
required
string
kind
required

Hard = non-overridable.

string
Allowed values: soft hard
priority
required
integer
status
required
string
Allowed values: proposed active superseded retired
supersedes_id

The prior rev this row superseded (rule_…).

string
author_kind
required
string
Allowed values: agent human
created_at
required
string format: date-time
updated_at
required
string format: date-time
total
required
integer
house_style_version
integer
category_rules_version
integer
rule_high_water
integer
composition_token

Opaque short-lived proof of this exact effective rules snapshot. Omitted on filtered scope queries.

string
composition_token_expires_at
string format: date-time

Missing or invalid credential.

The canonical error envelope. error is a stable machine code.

object
error
required

Stable error code (e.g. unauthorized, forbidden, not_found, invalid, quota_exceeded, rate_limited).

string
Example
forbidden
message

Human-readable detail (never leaks internals).

string
Example
missing required scope

Authenticated but lacking the required scope, or out of quota.

The canonical error envelope. error is a stable machine code.

object
error
required

Stable error code (e.g. unauthorized, forbidden, not_found, invalid, quota_exceeded, rate_limited).

string
Example
forbidden
message

Human-readable detail (never leaks internals).

string
Example
missing required scope

Resource not found.

The canonical error envelope. error is a stable machine code.

object
error
required

Stable error code (e.g. unauthorized, forbidden, not_found, invalid, quota_exceeded, rate_limited).

string
Example
forbidden
message

Human-readable detail (never leaks internals).

string
Example
missing required scope