Skip to main content
PATCH
Update draft version rules in place

Authorizations

Authorization
string
header
required

MeshQu API key passed as a bearer token: Authorization: Bearer mqu_…. Mint one in the console (Settings → API keys).

X-MeshQu-Tenant-Id
string
header
required

Tenant UUID for multi-tenant isolation. Required on all authenticated routes — validated before authentication (middleware/tenant.ts), so a missing or non-UUID header returns 400 (MISSING_TENANT_ID / INVALID_TENANT_ID) before the API key is checked.

Path Parameters

id
string<uuid>
required
version
integer
required
Required range: x >= 1

Body

application/json
expected_revision
integer
required
Required range: x >= 0
rules
object[]
Minimum array length: 1
change_reason
string
Required string length: 1 - 1000

Response

Default Response

id
string<uuid>
required
policy_id
string<uuid>
required
version
integer
required
draft_revision
integer
required
Required range: x >= 0
rules
object[]
required
active_rules_hash
string
required

SHA-256 hex of projectActiveRules(rules) — the same projection and hash the review-submission seal's active_rules_hash and the ratification receipt's policy_rules_hash use. Compare against a sealed subject's active_rules_hash to tell whether the ACTIVE RULES' EVALUATED CONTENT (code/condition/severity/when, in stored order) is unchanged since that seal — not whether the rule objects as a whole (name, description, source_ref, an added inactive rule) are unchanged.

Pattern: ^[0-9a-f]{64}$
is_active
boolean
required
status
required

Lifecycle status: draft → submitted → ratified → (activated, then) superseded (or back to draft on reject); discarded = soft-discarded draft (PWB-039). A pending version that ends without governing is closed: reopened (a ratified version whose content continues as a new draft), set_aside (put aside with a reason), replaced (a draft whose correction continues as a new draft) — PAL-004/005.

Available options:
draft
created_at
string<date-time>
required
created_by
string | null
required
change_reason
string | null
required
ratified_by
string
ratified_at
string<date-time>
submitted_by
string
submitted_at
string<date-time>
rejected_by
string
rejected_at
string<date-time>
rejection_reason
string
closed_at
string<date-time>
closed_by
string
closed_reason
string
supersedes_version_id
string<uuid>

Present only on a version created by draft supersession: the id of the replaced draft this version continues. Written when the version is created and never changed. Absent on every other version, including one started after a set-aside or a reopen.

codification_record
object

What the codification that produced this version accounted for. Unsigned and unhashed; NOT a sealed review package.