Update a corrective action plan
curl --request PATCH \
--url https://api.example.com/remediation/caps/{cap_id} \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 123,
"owner": "<string>",
"due_date": "<string>",
"problem_statement": "<string>",
"root_cause": "<string>",
"containment_action": "<string>",
"corrective_action": "<string>",
"preventive_action": "<string>",
"success_metric": "<string>",
"verification_evidence": "<string>"
}
'import requests
url = "https://api.example.com/remediation/caps/{cap_id}"
payload = {
"expected_version": 123,
"owner": "<string>",
"due_date": "<string>",
"problem_statement": "<string>",
"root_cause": "<string>",
"containment_action": "<string>",
"corrective_action": "<string>",
"preventive_action": "<string>",
"success_metric": "<string>",
"verification_evidence": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 123,
owner: '<string>',
due_date: '<string>',
problem_statement: '<string>',
root_cause: '<string>',
containment_action: '<string>',
corrective_action: '<string>',
preventive_action: '<string>',
success_metric: '<string>',
verification_evidence: '<string>'
})
};
fetch('https://api.example.com/remediation/caps/{cap_id}', 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.example.com/remediation/caps/{cap_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 123,
'owner' => '<string>',
'due_date' => '<string>',
'problem_statement' => '<string>',
'root_cause' => '<string>',
'containment_action' => '<string>',
'corrective_action' => '<string>',
'preventive_action' => '<string>',
'success_metric' => '<string>',
'verification_evidence' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/remediation/caps/{cap_id}"
payload := strings.NewReader("{\n \"expected_version\": 123,\n \"owner\": \"<string>\",\n \"due_date\": \"<string>\",\n \"problem_statement\": \"<string>\",\n \"root_cause\": \"<string>\",\n \"containment_action\": \"<string>\",\n \"corrective_action\": \"<string>\",\n \"preventive_action\": \"<string>\",\n \"success_metric\": \"<string>\",\n \"verification_evidence\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.example.com/remediation/caps/{cap_id}")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 123,\n \"owner\": \"<string>\",\n \"due_date\": \"<string>\",\n \"problem_statement\": \"<string>\",\n \"root_cause\": \"<string>\",\n \"containment_action\": \"<string>\",\n \"corrective_action\": \"<string>\",\n \"preventive_action\": \"<string>\",\n \"success_metric\": \"<string>\",\n \"verification_evidence\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/remediation/caps/{cap_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 123,\n \"owner\": \"<string>\",\n \"due_date\": \"<string>\",\n \"problem_statement\": \"<string>\",\n \"root_cause\": \"<string>\",\n \"containment_action\": \"<string>\",\n \"corrective_action\": \"<string>\",\n \"preventive_action\": \"<string>\",\n \"success_metric\": \"<string>\",\n \"verification_evidence\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_type": "<string>",
"target_id": "<string>",
"title": "<string>",
"status": "proposed",
"version": 123,
"due_date": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"owner": "<string>",
"problem_statement": "",
"root_cause": "",
"containment_action": "",
"corrective_action": "",
"preventive_action": "",
"success_metric": "",
"verification_evidence": "",
"path_tier": "governed",
"proof_window_days": 30,
"steps": {},
"proof_started_at": "<string>",
"proof_verified_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Remediation
Update a corrective action plan
Requires the caps.write permission + CSRF. Optimistic concurrency: the request body must carry expected_version; a mismatch returns 409 (“refresh and retry”). A status change is checked against a fixed transition table (proposed -> approved -> in_progress -> blocked/completed -> verified/rejected); an out-of-order transition returns 422. On success, increments the CAP’s version, writes an audit_log row (tenant schema) (cap_updated) with only the fields that changed, and returns the updated record. 404 if the CAP does not exist.
PATCH
/
remediation
/
caps
/
{cap_id}
Update a corrective action plan
curl --request PATCH \
--url https://api.example.com/remediation/caps/{cap_id} \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 123,
"owner": "<string>",
"due_date": "<string>",
"problem_statement": "<string>",
"root_cause": "<string>",
"containment_action": "<string>",
"corrective_action": "<string>",
"preventive_action": "<string>",
"success_metric": "<string>",
"verification_evidence": "<string>"
}
'import requests
url = "https://api.example.com/remediation/caps/{cap_id}"
payload = {
"expected_version": 123,
"owner": "<string>",
"due_date": "<string>",
"problem_statement": "<string>",
"root_cause": "<string>",
"containment_action": "<string>",
"corrective_action": "<string>",
"preventive_action": "<string>",
"success_metric": "<string>",
"verification_evidence": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 123,
owner: '<string>',
due_date: '<string>',
problem_statement: '<string>',
root_cause: '<string>',
containment_action: '<string>',
corrective_action: '<string>',
preventive_action: '<string>',
success_metric: '<string>',
verification_evidence: '<string>'
})
};
fetch('https://api.example.com/remediation/caps/{cap_id}', 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.example.com/remediation/caps/{cap_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 123,
'owner' => '<string>',
'due_date' => '<string>',
'problem_statement' => '<string>',
'root_cause' => '<string>',
'containment_action' => '<string>',
'corrective_action' => '<string>',
'preventive_action' => '<string>',
'success_metric' => '<string>',
'verification_evidence' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/remediation/caps/{cap_id}"
payload := strings.NewReader("{\n \"expected_version\": 123,\n \"owner\": \"<string>\",\n \"due_date\": \"<string>\",\n \"problem_statement\": \"<string>\",\n \"root_cause\": \"<string>\",\n \"containment_action\": \"<string>\",\n \"corrective_action\": \"<string>\",\n \"preventive_action\": \"<string>\",\n \"success_metric\": \"<string>\",\n \"verification_evidence\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.example.com/remediation/caps/{cap_id}")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 123,\n \"owner\": \"<string>\",\n \"due_date\": \"<string>\",\n \"problem_statement\": \"<string>\",\n \"root_cause\": \"<string>\",\n \"containment_action\": \"<string>\",\n \"corrective_action\": \"<string>\",\n \"preventive_action\": \"<string>\",\n \"success_metric\": \"<string>\",\n \"verification_evidence\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/remediation/caps/{cap_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 123,\n \"owner\": \"<string>\",\n \"due_date\": \"<string>\",\n \"problem_statement\": \"<string>\",\n \"root_cause\": \"<string>\",\n \"containment_action\": \"<string>\",\n \"corrective_action\": \"<string>\",\n \"preventive_action\": \"<string>\",\n \"success_metric\": \"<string>\",\n \"verification_evidence\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_type": "<string>",
"target_id": "<string>",
"title": "<string>",
"status": "proposed",
"version": 123,
"due_date": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"owner": "<string>",
"problem_statement": "",
"root_cause": "",
"containment_action": "",
"corrective_action": "",
"preventive_action": "",
"success_metric": "",
"verification_evidence": "",
"path_tier": "governed",
"proof_window_days": 30,
"steps": {},
"proof_started_at": "<string>",
"proof_verified_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
application/json
Available options:
proposed, approved, in_progress, blocked, completed, verified, rejected Available options:
automated, governed, expert Response
Successful Response
Available options:
proposed, approved, in_progress, blocked, completed, verified, rejected Available options:
automated, governed, expert