curl --request POST \
--url https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-MeshQu-Tenant-Id: <api-key>' \
--data '
{
"expected_revision": 1,
"rules": [
{
"code": "<string>",
"name": "<string>",
"rule_type": "presence",
"condition": {
"required_fields": [
"<string>"
],
"forbidden_fields": [
"<string>"
],
"min_length": {}
},
"severity": "low",
"description": "<string>",
"is_active": true,
"when": {
"field": "<string>",
"equals": "<string>",
"case_sensitive": true
},
"source_ref": {
"document": "<string>",
"section": "<string>",
"url": "<string>"
},
"replaces_rule_code": "<string>"
}
],
"codification": {
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"rule_units": {},
"dispositions": [
{
"unit_id": "<string>",
"disposition": "ambiguous",
"reason": "<string>"
}
]
},
"authoring_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_reason": "<string>"
}
'import requests
url = "https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned"
payload = {
"expected_revision": 1,
"rules": [
{
"code": "<string>",
"name": "<string>",
"rule_type": "presence",
"condition": {
"required_fields": ["<string>"],
"forbidden_fields": ["<string>"],
"min_length": {}
},
"severity": "low",
"description": "<string>",
"is_active": True,
"when": {
"field": "<string>",
"equals": "<string>",
"case_sensitive": True
},
"source_ref": {
"document": "<string>",
"section": "<string>",
"url": "<string>"
},
"replaces_rule_code": "<string>"
}
],
"codification": {
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"rule_units": {},
"dispositions": [
{
"unit_id": "<string>",
"disposition": "ambiguous",
"reason": "<string>"
}
]
},
"authoring_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"X-MeshQu-Tenant-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-MeshQu-Tenant-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
expected_revision: 1,
rules: [
{
code: '<string>',
name: '<string>',
rule_type: 'presence',
condition: {required_fields: ['<string>'], forbidden_fields: ['<string>'], min_length: {}},
severity: 'low',
description: '<string>',
is_active: true,
when: {field: '<string>', equals: '<string>', case_sensitive: true},
source_ref: {document: '<string>', section: '<string>', url: '<string>'},
replaces_rule_code: '<string>'
}
],
codification: {
source: {document: '<string>', url: '<string>'},
clauses: [{unit_id: '<string>', locator: '<string>', text: '<string>'}],
rule_units: {},
dispositions: [{unit_id: '<string>', disposition: 'ambiguous', reason: '<string>'}]
},
authoring_capability_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
change_reason: '<string>'
})
};
fetch('https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expected_revision' => 1,
'rules' => [
[
'code' => '<string>',
'name' => '<string>',
'rule_type' => 'presence',
'condition' => [
'required_fields' => [
'<string>'
],
'forbidden_fields' => [
'<string>'
],
'min_length' => [
]
],
'severity' => 'low',
'description' => '<string>',
'is_active' => true,
'when' => [
'field' => '<string>',
'equals' => '<string>',
'case_sensitive' => true
],
'source_ref' => [
'document' => '<string>',
'section' => '<string>',
'url' => '<string>'
],
'replaces_rule_code' => '<string>'
]
],
'codification' => [
'source' => [
'document' => '<string>',
'url' => '<string>'
],
'clauses' => [
[
'unit_id' => '<string>',
'locator' => '<string>',
'text' => '<string>'
]
],
'rule_units' => [
],
'dispositions' => [
[
'unit_id' => '<string>',
'disposition' => 'ambiguous',
'reason' => '<string>'
]
]
],
'authoring_capability_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'change_reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-MeshQu-Tenant-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned"
payload := strings.NewReader("{\n \"expected_revision\": 1,\n \"rules\": [\n {\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"rule_type\": \"presence\",\n \"condition\": {\n \"required_fields\": [\n \"<string>\"\n ],\n \"forbidden_fields\": [\n \"<string>\"\n ],\n \"min_length\": {}\n },\n \"severity\": \"low\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"when\": {\n \"field\": \"<string>\",\n \"equals\": \"<string>\",\n \"case_sensitive\": true\n },\n \"source_ref\": {\n \"document\": \"<string>\",\n \"section\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"replaces_rule_code\": \"<string>\"\n }\n ],\n \"codification\": {\n \"source\": {\n \"document\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"clauses\": [\n {\n \"unit_id\": \"<string>\",\n \"locator\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"rule_units\": {},\n \"dispositions\": [\n {\n \"unit_id\": \"<string>\",\n \"disposition\": \"ambiguous\",\n \"reason\": \"<string>\"\n }\n ]\n },\n \"authoring_capability_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change_reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-MeshQu-Tenant-Id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned")
.header("Authorization", "Bearer <token>")
.header("X-MeshQu-Tenant-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": 1,\n \"rules\": [\n {\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"rule_type\": \"presence\",\n \"condition\": {\n \"required_fields\": [\n \"<string>\"\n ],\n \"forbidden_fields\": [\n \"<string>\"\n ],\n \"min_length\": {}\n },\n \"severity\": \"low\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"when\": {\n \"field\": \"<string>\",\n \"equals\": \"<string>\",\n \"case_sensitive\": true\n },\n \"source_ref\": {\n \"document\": \"<string>\",\n \"section\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"replaces_rule_code\": \"<string>\"\n }\n ],\n \"codification\": {\n \"source\": {\n \"document\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"clauses\": [\n {\n \"unit_id\": \"<string>\",\n \"locator\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"rule_units\": {},\n \"dispositions\": [\n {\n \"unit_id\": \"<string>\",\n \"disposition\": \"ambiguous\",\n \"reason\": \"<string>\"\n }\n ]\n },\n \"authoring_capability_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-MeshQu-Tenant-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_revision\": 1,\n \"rules\": [\n {\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"rule_type\": \"presence\",\n \"condition\": {\n \"required_fields\": [\n \"<string>\"\n ],\n \"forbidden_fields\": [\n \"<string>\"\n ],\n \"min_length\": {}\n },\n \"severity\": \"low\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"when\": {\n \"field\": \"<string>\",\n \"equals\": \"<string>\",\n \"case_sensitive\": true\n },\n \"source_ref\": {\n \"document\": \"<string>\",\n \"section\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"replaces_rule_code\": \"<string>\"\n }\n ],\n \"codification\": {\n \"source\": {\n \"document\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"clauses\": [\n {\n \"unit_id\": \"<string>\",\n \"locator\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"rule_units\": {},\n \"dispositions\": [\n {\n \"unit_id\": \"<string>\",\n \"disposition\": \"ambiguous\",\n \"reason\": \"<string>\"\n }\n ]\n },\n \"authoring_capability_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"replaced": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"draft_revision": 1,
"is_active": true,
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"change_reason": "<string>",
"ratified_by": "<string>",
"ratified_at": "2023-11-07T05:31:56Z",
"submitted_by": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"rejected_by": "<string>",
"rejected_at": "2023-11-07T05:31:56Z",
"rejection_reason": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"closed_reason": "<string>",
"supersedes_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"codification_record": {
"schema": "meshqu-codification-record/v1",
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"ledger": [
{
"unit_id": "<string>",
"disposition": "mapped",
"note": "<string>"
}
],
"counts": {
"clauses": 123,
"mapped": 123,
"ambiguous": 123,
"unsupported": 123,
"non_normative": 123,
"refused": 123
},
"refusals": [
{
"unit_id": "<string>",
"rule_code": "<string>",
"kind": "<string>",
"message": "<string>"
}
],
"lint": {
"schema": "meshqu-codification-lint/v1",
"status": "ran",
"answerer": "jev",
"questions_version": "<string>",
"floor": 123,
"clauses": [
{
"unit_id": "<string>",
"findings": [
{
"code": "guidance_as_obligation",
"message": "<string>",
"evidence": {
"confidence": 123
}
}
],
"needs_context": true
}
],
"reason": "<string>",
"model": "<string>",
"elapsed_ms": 123
}
}
},
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"draft_revision": 1,
"rules": [
{
"code": "<string>",
"name": "<string>",
"rule_type": "presence",
"condition": {
"required_fields": [
"<string>"
],
"forbidden_fields": [
"<string>"
],
"min_length": {}
},
"severity": "low",
"description": "<string>",
"is_active": true,
"when": {
"field": "<string>",
"equals": "<string>",
"case_sensitive": true
},
"source_ref": {
"document": "<string>",
"section": "<string>",
"url": "<string>"
},
"replaces_rule_code": "<string>"
}
],
"is_active": true,
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"change_reason": "<string>",
"ratified_by": "<string>",
"ratified_at": "2023-11-07T05:31:56Z",
"submitted_by": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"rejected_by": "<string>",
"rejected_at": "2023-11-07T05:31:56Z",
"rejection_reason": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"closed_reason": "<string>",
"supersedes_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"codification_record": {
"schema": "meshqu-codification-record/v1",
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"ledger": [
{
"unit_id": "<string>",
"disposition": "mapped",
"note": "<string>"
}
],
"counts": {
"clauses": 123,
"mapped": 123,
"ambiguous": 123,
"unsupported": 123,
"non_normative": 123,
"refused": 123
},
"refusals": [
{
"unit_id": "<string>",
"rule_code": "<string>",
"kind": "<string>",
"message": "<string>"
}
],
"lint": {
"schema": "meshqu-codification-lint/v1",
"status": "ran",
"answerer": "jev",
"questions_version": "<string>",
"floor": 123,
"clauses": [
{
"unit_id": "<string>",
"findings": [
{
"code": "guidance_as_obligation",
"message": "<string>",
"evidence": {
"confidence": 123
}
}
],
"needs_context": true
}
],
"reason": "<string>",
"model": "<string>",
"elapsed_ms": 123
}
}
},
"authoring_capability": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"record_type": "grant",
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revokes_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"granted_by": "<string>",
"grant_authority": "<string>",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_version_number": 123,
"allowed_actions": [
"policy.read"
],
"source_item_ids": [
"<string>"
],
"valid_from": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"capability_digest": "<string>",
"grantor_signature": {
"signature": "<string>",
"signature_kid": "<string>",
"signature_algorithm": "ed25519"
},
"created_at": "2023-11-07T05:31:56Z",
"root_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_declaration": {
"model": "<string>",
"version": "<string>",
"instruction_digest": "<string>",
"harness": "<string>"
},
"succeeds_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}Supersede the assigned draft under an authoring capability
Corrects the DRAFT an authoring capability is bound to without overwriting it, and carries the capability to the corrected draft. In one transaction: the draft is closed with status “replaced” (kept as history exactly as it was, codification record and lint findings included); the corrected rules become a NEW draft through the same path as version creation (the required codification block is codified and linted afresh), whose supersedes_version_id names the replaced draft; and a NEW authoring capability grant is minted naming the new draft. The new grant copies every other field of the admitting grant verbatim (key, policy, granted_by, grant_authority, allowed actions, source items, validity window and agent declaration), carries succeeds_capability_id = the admitting grant, and is returned as authoring_capability. Send ITS id as authoring_capability_id from then on. If the response is lost, GET /v1/authoring-capabilities/current returns it. Nothing is written on any refusal.
Reachable only by a credential holding the authoring:capability scope and no policies:read / policies:write, whose capability grants draft.edit and is bound to exactly this :id and :version. A broad key and a human session receive 403 FORBIDDEN.
Refusals: 400 FST_ERR_VALIDATION (unknown field, missing codification); 403 AUTHORING_CAPABILITY_ID_MISMATCH (no capability admitted this request, or authoring_capability_id is not, byte for byte, the admitting capability); 403 AUTHORING_CAPABILITY_* from the capability gate — missing, revoked or exhausted (anywhere in its chain), expired, not yet valid, out of scope, object mismatch, integrity failure — and the same codes when the capability is re-checked under the row lock and has changed since the request was admitted; 403 AUTHORING_CAPABILITY_SUBJECT_NOT_LICENSED (the tenant enforces agent licences and this key holds no live one), AUTHORING_CAPABILITY_SUBJECT_REVOKED or AUTHORING_CAPABILITY_SUBJECT_EXPIRED (this key was deactivated or expired after the request was admitted) — all three checked inside the transaction, after its locks; 404 NOT_FOUND; 409 INVALID_TRANSITION with details.reason VERSION_NOT_DRAFT; 409 STALE_DRAFT_REVISION with the current candidate; 409 DRAFT_CONFLICT; 409 AUTHORING_CAPABILITY_CHAIN_LIMIT (the capability a human issued has already been carried 20 times — a human must issue a new one); 422 VALIDATION_ERROR / UNSUPPORTED_RULE_TYPE / CODIFICATION_REFUSED; 500 RATIFIER_KEY_REQUIRED / RATIFIER_KID_NOT_TRUSTED / AUTHORING_CAPABILITY_SELF_VERIFICATION_FAILED (deployment faults).
curl --request POST \
--url https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-MeshQu-Tenant-Id: <api-key>' \
--data '
{
"expected_revision": 1,
"rules": [
{
"code": "<string>",
"name": "<string>",
"rule_type": "presence",
"condition": {
"required_fields": [
"<string>"
],
"forbidden_fields": [
"<string>"
],
"min_length": {}
},
"severity": "low",
"description": "<string>",
"is_active": true,
"when": {
"field": "<string>",
"equals": "<string>",
"case_sensitive": true
},
"source_ref": {
"document": "<string>",
"section": "<string>",
"url": "<string>"
},
"replaces_rule_code": "<string>"
}
],
"codification": {
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"rule_units": {},
"dispositions": [
{
"unit_id": "<string>",
"disposition": "ambiguous",
"reason": "<string>"
}
]
},
"authoring_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_reason": "<string>"
}
'import requests
url = "https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned"
payload = {
"expected_revision": 1,
"rules": [
{
"code": "<string>",
"name": "<string>",
"rule_type": "presence",
"condition": {
"required_fields": ["<string>"],
"forbidden_fields": ["<string>"],
"min_length": {}
},
"severity": "low",
"description": "<string>",
"is_active": True,
"when": {
"field": "<string>",
"equals": "<string>",
"case_sensitive": True
},
"source_ref": {
"document": "<string>",
"section": "<string>",
"url": "<string>"
},
"replaces_rule_code": "<string>"
}
],
"codification": {
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"rule_units": {},
"dispositions": [
{
"unit_id": "<string>",
"disposition": "ambiguous",
"reason": "<string>"
}
]
},
"authoring_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"change_reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"X-MeshQu-Tenant-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-MeshQu-Tenant-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
expected_revision: 1,
rules: [
{
code: '<string>',
name: '<string>',
rule_type: 'presence',
condition: {required_fields: ['<string>'], forbidden_fields: ['<string>'], min_length: {}},
severity: 'low',
description: '<string>',
is_active: true,
when: {field: '<string>', equals: '<string>', case_sensitive: true},
source_ref: {document: '<string>', section: '<string>', url: '<string>'},
replaces_rule_code: '<string>'
}
],
codification: {
source: {document: '<string>', url: '<string>'},
clauses: [{unit_id: '<string>', locator: '<string>', text: '<string>'}],
rule_units: {},
dispositions: [{unit_id: '<string>', disposition: 'ambiguous', reason: '<string>'}]
},
authoring_capability_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
change_reason: '<string>'
})
};
fetch('https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expected_revision' => 1,
'rules' => [
[
'code' => '<string>',
'name' => '<string>',
'rule_type' => 'presence',
'condition' => [
'required_fields' => [
'<string>'
],
'forbidden_fields' => [
'<string>'
],
'min_length' => [
]
],
'severity' => 'low',
'description' => '<string>',
'is_active' => true,
'when' => [
'field' => '<string>',
'equals' => '<string>',
'case_sensitive' => true
],
'source_ref' => [
'document' => '<string>',
'section' => '<string>',
'url' => '<string>'
],
'replaces_rule_code' => '<string>'
]
],
'codification' => [
'source' => [
'document' => '<string>',
'url' => '<string>'
],
'clauses' => [
[
'unit_id' => '<string>',
'locator' => '<string>',
'text' => '<string>'
]
],
'rule_units' => [
],
'dispositions' => [
[
'unit_id' => '<string>',
'disposition' => 'ambiguous',
'reason' => '<string>'
]
]
],
'authoring_capability_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'change_reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-MeshQu-Tenant-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned"
payload := strings.NewReader("{\n \"expected_revision\": 1,\n \"rules\": [\n {\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"rule_type\": \"presence\",\n \"condition\": {\n \"required_fields\": [\n \"<string>\"\n ],\n \"forbidden_fields\": [\n \"<string>\"\n ],\n \"min_length\": {}\n },\n \"severity\": \"low\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"when\": {\n \"field\": \"<string>\",\n \"equals\": \"<string>\",\n \"case_sensitive\": true\n },\n \"source_ref\": {\n \"document\": \"<string>\",\n \"section\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"replaces_rule_code\": \"<string>\"\n }\n ],\n \"codification\": {\n \"source\": {\n \"document\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"clauses\": [\n {\n \"unit_id\": \"<string>\",\n \"locator\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"rule_units\": {},\n \"dispositions\": [\n {\n \"unit_id\": \"<string>\",\n \"disposition\": \"ambiguous\",\n \"reason\": \"<string>\"\n }\n ]\n },\n \"authoring_capability_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change_reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-MeshQu-Tenant-Id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned")
.header("Authorization", "Bearer <token>")
.header("X-MeshQu-Tenant-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": 1,\n \"rules\": [\n {\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"rule_type\": \"presence\",\n \"condition\": {\n \"required_fields\": [\n \"<string>\"\n ],\n \"forbidden_fields\": [\n \"<string>\"\n ],\n \"min_length\": {}\n },\n \"severity\": \"low\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"when\": {\n \"field\": \"<string>\",\n \"equals\": \"<string>\",\n \"case_sensitive\": true\n },\n \"source_ref\": {\n \"document\": \"<string>\",\n \"section\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"replaces_rule_code\": \"<string>\"\n }\n ],\n \"codification\": {\n \"source\": {\n \"document\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"clauses\": [\n {\n \"unit_id\": \"<string>\",\n \"locator\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"rule_units\": {},\n \"dispositions\": [\n {\n \"unit_id\": \"<string>\",\n \"disposition\": \"ambiguous\",\n \"reason\": \"<string>\"\n }\n ]\n },\n \"authoring_capability_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change_reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meshqu.com/v1/policies/{id}/versions/{version}/supersede-assigned")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-MeshQu-Tenant-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_revision\": 1,\n \"rules\": [\n {\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"rule_type\": \"presence\",\n \"condition\": {\n \"required_fields\": [\n \"<string>\"\n ],\n \"forbidden_fields\": [\n \"<string>\"\n ],\n \"min_length\": {}\n },\n \"severity\": \"low\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"when\": {\n \"field\": \"<string>\",\n \"equals\": \"<string>\",\n \"case_sensitive\": true\n },\n \"source_ref\": {\n \"document\": \"<string>\",\n \"section\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"replaces_rule_code\": \"<string>\"\n }\n ],\n \"codification\": {\n \"source\": {\n \"document\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"clauses\": [\n {\n \"unit_id\": \"<string>\",\n \"locator\": \"<string>\",\n \"text\": \"<string>\"\n }\n ],\n \"rule_units\": {},\n \"dispositions\": [\n {\n \"unit_id\": \"<string>\",\n \"disposition\": \"ambiguous\",\n \"reason\": \"<string>\"\n }\n ]\n },\n \"authoring_capability_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"change_reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"replaced": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"draft_revision": 1,
"is_active": true,
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"change_reason": "<string>",
"ratified_by": "<string>",
"ratified_at": "2023-11-07T05:31:56Z",
"submitted_by": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"rejected_by": "<string>",
"rejected_at": "2023-11-07T05:31:56Z",
"rejection_reason": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"closed_reason": "<string>",
"supersedes_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"codification_record": {
"schema": "meshqu-codification-record/v1",
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"ledger": [
{
"unit_id": "<string>",
"disposition": "mapped",
"note": "<string>"
}
],
"counts": {
"clauses": 123,
"mapped": 123,
"ambiguous": 123,
"unsupported": 123,
"non_normative": 123,
"refused": 123
},
"refusals": [
{
"unit_id": "<string>",
"rule_code": "<string>",
"kind": "<string>",
"message": "<string>"
}
],
"lint": {
"schema": "meshqu-codification-lint/v1",
"status": "ran",
"answerer": "jev",
"questions_version": "<string>",
"floor": 123,
"clauses": [
{
"unit_id": "<string>",
"findings": [
{
"code": "guidance_as_obligation",
"message": "<string>",
"evidence": {
"confidence": 123
}
}
],
"needs_context": true
}
],
"reason": "<string>",
"model": "<string>",
"elapsed_ms": 123
}
}
},
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"draft_revision": 1,
"rules": [
{
"code": "<string>",
"name": "<string>",
"rule_type": "presence",
"condition": {
"required_fields": [
"<string>"
],
"forbidden_fields": [
"<string>"
],
"min_length": {}
},
"severity": "low",
"description": "<string>",
"is_active": true,
"when": {
"field": "<string>",
"equals": "<string>",
"case_sensitive": true
},
"source_ref": {
"document": "<string>",
"section": "<string>",
"url": "<string>"
},
"replaces_rule_code": "<string>"
}
],
"is_active": true,
"status": "draft",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"change_reason": "<string>",
"ratified_by": "<string>",
"ratified_at": "2023-11-07T05:31:56Z",
"submitted_by": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"rejected_by": "<string>",
"rejected_at": "2023-11-07T05:31:56Z",
"rejection_reason": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"closed_reason": "<string>",
"supersedes_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"codification_record": {
"schema": "meshqu-codification-record/v1",
"source": {
"document": "<string>",
"url": "<string>"
},
"clauses": [
{
"unit_id": "<string>",
"locator": "<string>",
"text": "<string>"
}
],
"ledger": [
{
"unit_id": "<string>",
"disposition": "mapped",
"note": "<string>"
}
],
"counts": {
"clauses": 123,
"mapped": 123,
"ambiguous": 123,
"unsupported": 123,
"non_normative": 123,
"refused": 123
},
"refusals": [
{
"unit_id": "<string>",
"rule_code": "<string>",
"kind": "<string>",
"message": "<string>"
}
],
"lint": {
"schema": "meshqu-codification-lint/v1",
"status": "ran",
"answerer": "jev",
"questions_version": "<string>",
"floor": 123,
"clauses": [
{
"unit_id": "<string>",
"findings": [
{
"code": "guidance_as_obligation",
"message": "<string>",
"evidence": {
"confidence": 123
}
}
],
"needs_context": true
}
],
"reason": "<string>",
"model": "<string>",
"elapsed_ms": 123
}
}
},
"authoring_capability": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"record_type": "grant",
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revokes_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"granted_by": "<string>",
"grant_authority": "<string>",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_version_number": 123,
"allowed_actions": [
"policy.read"
],
"source_item_ids": [
"<string>"
],
"valid_from": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"capability_digest": "<string>",
"grantor_signature": {
"signature": "<string>",
"signature_kid": "<string>",
"signature_algorithm": "ed25519"
},
"created_at": "2023-11-07T05:31:56Z",
"root_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_declaration": {
"model": "<string>",
"version": "<string>",
"instruction_digest": "<string>",
"harness": "<string>"
},
"succeeds_capability_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"correlation_id": "<string>"
}Authorizations
MeshQu API key passed as a bearer token: Authorization: Bearer mqu_…. Mint one in the console (Settings → API keys).
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.
Body
The draft_revision of the draft being superseded, as last read. A stale value is refused 409 STALE_DRAFT_REVISION with the current candidate.
x >= 0The corrected candidate.
1Show child attributes
Show child attributes
Optional. When present, the stored rules are the ones codify() returns — including source_ref, which codify() derives from the declared clause and does not take from the caller — not the ones submitted. See packages/meshqu-core/src/codification.ts.
Show child attributes
Show child attributes
The id of the authoring capability that admits this request, byte for byte. It confirms which capability is acting; it never selects one.
500Response
Default Response
The closed version, rules omitted (unchanged; GET the version to read them).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The authoring capability grant minted when this supersession carried the admitting capability to the new draft, as stored.
Show child attributes
Show child attributes