curl --request POST \
--url {scheme}://{host}:{port}/{basePath}/postmortems/{name}/close \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reviewer": "sre-oncall",
"notes": "All action items assigned. Root cause verified."
}
'import requests
url = "{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close"
payload = {
"reviewer": "sre-oncall",
"notes": "All action items assigned. Root cause verified."
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reviewer: 'sre-oncall',
notes: 'All action items assigned. Root cause verified.'
})
};
fetch('{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close",
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([
'reviewer' => 'sre-oncall',
'notes' => 'All action items assigned. Root cause verified.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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 := "{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close"
payload := strings.NewReader("{\n \"reviewer\": \"sre-oncall\",\n \"notes\": \"All action items assigned. Root cause verified.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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("{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reviewer\": \"sre-oncall\",\n \"notes\": \"All action items assigned. Root cause verified.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reviewer\": \"sre-oncall\",\n \"notes\": \"All action items assigned. Root cause verified.\"\n}"
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "PostMortem",
"spec": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"issueRef": "checkout-service-oom-kill-1773871200",
"resource": {
"kind": "Deployment",
"name": "checkout-service",
"namespace": "production"
},
"severity": "critical",
"state": "Closed",
"duration": "45m0s",
"generatedAt": "2026-03-18T22:45:00Z",
"reviewedAt": "2026-03-19T18:00:00Z",
"creationTimestamp": "2026-03-18T22:45:00Z"
},
"status": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"issueRef": "checkout-service-oom-kill-1773871200",
"resource": {
"kind": "Deployment",
"name": "checkout-service",
"namespace": "production"
},
"severity": "critical",
"state": "Closed",
"duration": "45m0s",
"generatedAt": "2026-03-18T22:45:00Z",
"reviewedAt": "2026-03-19T18:00:00Z",
"creationTimestamp": "2026-03-18T22:45:00Z"
},
"resourceMeta": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"uid": "3d9b8e61-2f4a-4b7c-8e15-6a0c9f2d7b43",
"creationTimestamp": "2026-03-18T22:45:00Z",
"annotations": {
"aiops.chatcli.io/reviewed-by": "sre-oncall",
"aiops.chatcli.io/review-notes": "Action items atribuídos. Causa raiz verificada."
}
}
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "postmortem not found: postmortems.platform.chatcli.io \"pm-checkout-service-oom-kill-1773871200\" not found"
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Conflict",
"code": 409,
"message": "postmortem was modified concurrently, please retry"
}
Fechar PostMortem
Fecha um postmortem após a revisão, marcando-o como finalizado e aceito pelo time
curl --request POST \
--url {scheme}://{host}:{port}/{basePath}/postmortems/{name}/close \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reviewer": "sre-oncall",
"notes": "All action items assigned. Root cause verified."
}
'import requests
url = "{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close"
payload = {
"reviewer": "sre-oncall",
"notes": "All action items assigned. Root cause verified."
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reviewer: 'sre-oncall',
notes: 'All action items assigned. Root cause verified.'
})
};
fetch('{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close",
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([
'reviewer' => 'sre-oncall',
'notes' => 'All action items assigned. Root cause verified.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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 := "{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close"
payload := strings.NewReader("{\n \"reviewer\": \"sre-oncall\",\n \"notes\": \"All action items assigned. Root cause verified.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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("{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reviewer\": \"sre-oncall\",\n \"notes\": \"All action items assigned. Root cause verified.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/postmortems/{name}/close")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reviewer\": \"sre-oncall\",\n \"notes\": \"All action items assigned. Root cause verified.\"\n}"
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "PostMortem",
"spec": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"issueRef": "checkout-service-oom-kill-1773871200",
"resource": {
"kind": "Deployment",
"name": "checkout-service",
"namespace": "production"
},
"severity": "critical",
"state": "Closed",
"duration": "45m0s",
"generatedAt": "2026-03-18T22:45:00Z",
"reviewedAt": "2026-03-19T18:00:00Z",
"creationTimestamp": "2026-03-18T22:45:00Z"
},
"status": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"issueRef": "checkout-service-oom-kill-1773871200",
"resource": {
"kind": "Deployment",
"name": "checkout-service",
"namespace": "production"
},
"severity": "critical",
"state": "Closed",
"duration": "45m0s",
"generatedAt": "2026-03-18T22:45:00Z",
"reviewedAt": "2026-03-19T18:00:00Z",
"creationTimestamp": "2026-03-18T22:45:00Z"
},
"resourceMeta": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"uid": "3d9b8e61-2f4a-4b7c-8e15-6a0c9f2d7b43",
"creationTimestamp": "2026-03-18T22:45:00Z",
"annotations": {
"aiops.chatcli.io/reviewed-by": "sre-oncall",
"aiops.chatcli.io/review-notes": "Action items atribuídos. Causa raiz verificada."
}
}
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "postmortem not found: postmortems.platform.chatcli.io \"pm-checkout-service-oom-kill-1773871200\" not found"
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Conflict",
"code": 409,
"message": "postmortem was modified concurrently, please retry"
}
pm-checkout-service-oom-kill-1773871200)default é pesquisado)aiops.chatcli.io/reviewed-by.aiops.chatcli.io/review-notes, somente quando reviewer também é enviado.Ciclo de vida do PostMortem
Gerado (na resolução ou contenção do incidente)
↓
Estado: Open
↓
POST /review → Estado: InReview
↓
POST /close → Estado: Closed
status.state como Closed e status.reviewedAt com o horário atual. Role mínima: operator. O handler REST não tem trava de estado (fechar duas vezes funciona, e /review pode reabrir um postmortem fechado), então Closed é um status, não uma garantia de imutabilidade.
requiresHumanAction: true (o operator conteve o incidente e uma pessoa precisa restaurar o workload), /close ainda retorna 200, mas o controller de PostMortem volta o estado para Open no próximo reconcile, a menos que a annotation aiops.chatcli.io/human-action-acknowledged esteja definida. Chame Reconhecer ação humana antes de fechar.{
"apiVersion": "v1",
"kind": "PostMortem",
"spec": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"issueRef": "checkout-service-oom-kill-1773871200",
"resource": {
"kind": "Deployment",
"name": "checkout-service",
"namespace": "production"
},
"severity": "critical",
"state": "Closed",
"duration": "45m0s",
"generatedAt": "2026-03-18T22:45:00Z",
"reviewedAt": "2026-03-19T18:00:00Z",
"creationTimestamp": "2026-03-18T22:45:00Z"
},
"status": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"issueRef": "checkout-service-oom-kill-1773871200",
"resource": {
"kind": "Deployment",
"name": "checkout-service",
"namespace": "production"
},
"severity": "critical",
"state": "Closed",
"duration": "45m0s",
"generatedAt": "2026-03-18T22:45:00Z",
"reviewedAt": "2026-03-19T18:00:00Z",
"creationTimestamp": "2026-03-18T22:45:00Z"
},
"resourceMeta": {
"name": "pm-checkout-service-oom-kill-1773871200",
"namespace": "production",
"uid": "3d9b8e61-2f4a-4b7c-8e15-6a0c9f2d7b43",
"creationTimestamp": "2026-03-18T22:45:00Z",
"annotations": {
"aiops.chatcli.io/reviewed-by": "sre-oncall",
"aiops.chatcli.io/review-notes": "Action items atribuídos. Causa raiz verificada."
}
}
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "postmortem not found: postmortems.platform.chatcli.io \"pm-checkout-service-oom-kill-1773871200\" not found"
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Conflict",
"code": 409,
"message": "postmortem was modified concurrently, please retry"
}
Autorizações
API key sent in the X-API-Key header. Keys are read from the Secret chatcli-operator-secrets, key api-keys (fallback: ConfigMap chatcli-operator-config, key api-keys) in the operator namespace, as a YAML list of {key, role, name, description} (name is the identity recorded on approval decisions); the operator chart creates it only with apiKeys.create: true. Roles: viewer < operator < admin — any other role string is denied everywhere. Changes are picked up within about 30 seconds; deleting both the Secret and the ConfigMap revokes every key. With no keys configured every /api/ call returns 401, unless CHATCLI_OPERATOR_DEV_MODE=true, which grants admin without a key (development only).
Parâmetros de caminho
PostMortem name.
"pm-payment-service-oom-1710860400"
Parâmetros de consulta
Namespace of the object. Defaults to default — pass it for objects in any other namespace.