curl --request POST \
--url https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen \
--header 'Authorization: Bearer <token>' \
--header 'X-MeshQu-Tenant-Id: <api-key>'import requests
url = "https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen"
headers = {
"Authorization": "Bearer <token>",
"X-MeshQu-Tenant-Id": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-MeshQu-Tenant-Id': '<api-key>'}
};
fetch('https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen', 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}/reopen",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-MeshQu-Tenant-Id", "<api-key>")
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}/reopen")
.header("Authorization", "Bearer <token>")
.header("X-MeshQu-Tenant-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen")
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>'
response = http.request(request)
puts response.read_body{
"reopened": {
"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>",
"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>",
"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
}
}
}
}{
"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>"
}Reopen a ratified version that is not in force
PAL-004. Returns a ratified version that is waiting for activation to editing, without changing it: the version is closed with status “reopened” (keeping its ratification and approval receipt as history, and never able to be put in force), and its rules continue as a NEW draft — the policy’s one pending version — which must be ratified again before it can be activated. The codification record is carried to the new draft only when the stored rules are identical. Human-only. Refusals: 404 NOT_FOUND (policy or version not in this tenant); 409 INVALID_TRANSITION with details.reason — VERSION_ALREADY_IN_FORCE, VERSION_NOT_RATIFIED (a draft or submitted version is edited as it is), VERSION_NOT_PENDING (superseded, discarded or already closed). Nothing is written on a refusal.
curl --request POST \
--url https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen \
--header 'Authorization: Bearer <token>' \
--header 'X-MeshQu-Tenant-Id: <api-key>'import requests
url = "https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen"
headers = {
"Authorization": "Bearer <token>",
"X-MeshQu-Tenant-Id": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-MeshQu-Tenant-Id': '<api-key>'}
};
fetch('https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen', 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}/reopen",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-MeshQu-Tenant-Id", "<api-key>")
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}/reopen")
.header("Authorization", "Bearer <token>")
.header("X-MeshQu-Tenant-Id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meshqu.com/v1/policies/{id}/versions/{version}/reopen")
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>'
response = http.request(request)
puts response.read_body{
"reopened": {
"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>",
"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>",
"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
}
}
}
}{
"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.