curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/policies/{kind} \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/policies/{kind}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('{scheme}://{host}:{port}/{basePath}/policies/{kind}', 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}/policies/{kind}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "{scheme}://{host}:{port}/{basePath}/policies/{kind}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{scheme}://{host}:{port}/{basePath}/policies/{kind}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/policies/{kind}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "ApprovalPolicyList",
"metadata": { "totalCount": 1, "page": 1, "pageSize": 20 },
"items": [
{
"name": "prod-rollbacks",
"namespace": "production",
"kind": "ApprovalPolicy",
"creationTimestamp": "2026-09-01T12:00:00Z",
"spec": {
"enabled": true,
"rules": [
{ "name": "rollback-requires-human", "match": { "actionTypes": ["RollbackDeployment"] }, "mode": "manual", "timeoutMinutes": 30, "requiredApprovers": 1 }
]
},
"status": { "totalApproved": 7, "totalRejected": 1 }
}
]
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "unknown policy kind: approvals"
}
Listar Políticas
Lista objetos ApprovalPolicy, NotificationPolicy, EscalationPolicy ou IncidentSLA com spec e status brutos — somente leitura
curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/policies/{kind} \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/policies/{kind}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('{scheme}://{host}:{port}/{basePath}/policies/{kind}', 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}/policies/{kind}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "{scheme}://{host}:{port}/{basePath}/policies/{kind}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{scheme}://{host}:{port}/{basePath}/policies/{kind}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/policies/{kind}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "ApprovalPolicyList",
"metadata": { "totalCount": 1, "page": 1, "pageSize": 20 },
"items": [
{
"name": "prod-rollbacks",
"namespace": "production",
"kind": "ApprovalPolicy",
"creationTimestamp": "2026-09-01T12:00:00Z",
"spec": {
"enabled": true,
"rules": [
{ "name": "rollback-requires-human", "match": { "actionTypes": ["RollbackDeployment"] }, "mode": "manual", "timeoutMinutes": 30, "requiredApprovers": 1 }
]
},
"status": { "totalApproved": 7, "totalRejected": 1 }
}
]
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "unknown policy kind: approvals"
}
approval, notification, escalation ou slakubectl ou GitOps, onde são revisadas; a API e a aba Políticas do dashboard só as leem. Cada item carrega o spec e o status do CRD sem alteração, então os campos seguem as definições de ApprovalPolicy, NotificationPolicy e EscalationPolicy e IncidentSLA.
Role mínima: viewer. Qualquer método diferente de GET retorna 405; um kind desconhecido retorna 404. Os itens não são filtrados por status nem ordenados.
{
"apiVersion": "v1",
"kind": "ApprovalPolicyList",
"metadata": { "totalCount": 1, "page": 1, "pageSize": 20 },
"items": [
{
"name": "prod-rollbacks",
"namespace": "production",
"kind": "ApprovalPolicy",
"creationTimestamp": "2026-09-01T12:00:00Z",
"spec": {
"enabled": true,
"rules": [
{ "name": "rollback-requires-human", "match": { "actionTypes": ["RollbackDeployment"] }, "mode": "manual", "timeoutMinutes": 30, "requiredApprovers": 1 }
]
},
"status": { "totalApproved": 7, "totalRejected": 1 }
}
]
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "unknown policy kind: approvals"
}
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
approval, notification, escalation or sla.
approval, notification, escalation, sla Parâmetros de consulta
Filter by namespace; empty lists every namespace.
Page number (1-based). Invalid values fall back to 1.
x >= 1Items per page. Values above 100 are capped at 100.
1 <= x <= 100