> ## Documentation Index
> Fetch the complete documentation index at: https://chatcli.edilsonfreitas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Listar Políticas

> Lista objetos ApprovalPolicy, NotificationPolicy, EscalationPolicy ou IncidentSLA com spec e status brutos — somente leitura

<ParamField path="kind" type="string" required>
  `approval`, `notification`, `escalation` ou `sla`
</ParamField>

<ParamField query="namespace" type="string">
  Filtrar por namespace. Vazio lista todos os namespaces.
</ParamField>

<ParamField query="page" type="integer" default="1">
  Número da página
</ParamField>

<ParamField query="pageSize" type="integer" default="20">
  Itens por página
</ParamField>

As políticas são escritas via `kubectl` 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](/pt/features/aiops/approval-workflow), [NotificationPolicy e EscalationPolicy](/pt/features/aiops/notifications) e [IncidentSLA](/pt/features/aiops/slo-sla).

<ResponseExample>
  ```json Response 200 theme={"system"}
  {
    "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 }
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /policies/{kind}
openapi: 3.1.0
info:
  title: ChatCLI AIOps Platform API
  description: >-
    REST API for the ChatCLI AIOps Platform — incidents, SLOs, runbooks,
    approvals, postmortems, analytics, audit, federation and health.


    The playground below uses **editable server variables** so you can point
    requests at your own self-hosted instance. Adjust `host`, `port` and
    `basePath` to match your deployment, then click **Try it**.
  version: 1.0.0
  contact:
    name: ChatCLI
    url: https://github.com/diillson/chatcli
  license:
    name: Apache-2.0
    identifier: Apache-2.0
servers:
  - url: http://{host}:{port}/{basePath}
    description: >-
      Self-hosted ChatCLI AIOps Platform — adjust host, port and basePath to
      match your deployment.
    variables:
      host:
        default: localhost
        description: >-
          Hostname or IP of your ChatCLI operator. For Kubernetes, use the
          Service DNS (e.g. chatcli-api.chatcli-system.svc) or your Ingress
          host.
      port:
        default: '8090'
        description: >-
          Port the API listens on. Default is 8090; configurable via Helm value
          `apiPort` or env var CHATCLI_API_PORT.
      basePath:
        default: api/v1
        description: >-
          API base path. Always `api/v1` unless you have a custom proxy rewrite
          in front of the operator.
security:
  - ApiKeyAuth: []
tags:
  - name: Incidents
    description: >-
      Incident lifecycle: list, fetch, acknowledge, resolve, snooze, timeline
      and remediation views.
  - name: Runbooks
    description: Remediation runbooks (list, create, update, delete).
  - name: SLOs
    description: Service Level Objectives and error budgets.
  - name: Approvals
    description: Approval workflow for risky remediations.
  - name: Postmortems
    description: Auto-generated postmortems with review, feedback and close.
  - name: Remediations
    description: Remediation plans and agentic execution history.
  - name: AI Insights
    description: AI root-cause analysis and recommendations per incident.
  - name: Analytics
    description: 'Operational analytics: MTTD, MTTR, trends, capacity, compliance.'
  - name: Audit
    description: Immutable audit log and exports.
  - name: Federation
    description: 'Multi-cluster federation: clusters, status and cross-cluster correlations.'
  - name: Policies
    description: >-
      Read-only view of ApprovalPolicy, NotificationPolicy, EscalationPolicy and
      IncidentSLA objects.
  - name: Health
    description: Liveness and readiness probes.
paths:
  /policies/{kind}:
    get:
      tags:
        - Policies
      summary: List Policies
      description: >-
        Lists the policies of one kind: approval (ApprovalPolicy), notification
        (NotificationPolicy), escalation (EscalationPolicy) or sla
        (IncidentSLA). Read-only: policies are written through kubectl or
        GitOps. Each item carries its raw spec and status.
      operationId: listPolicies
      parameters:
        - name: kind
          in: path
          required: true
          description: approval, notification, escalation or sla.
          schema:
            type: string
            enum:
              - approval
              - notification
              - escalation
              - sla
        - name: namespace
          in: query
          required: false
          description: Filter by namespace; empty lists every namespace.
          schema:
            type: string
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            default: 20
      responses:
        '200':
          description: Policy list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Unknown policy kind
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    PolicyList:
      type: object
      properties:
        apiVersion:
          type: string
          example: v1
        kind:
          type: string
          example: ApprovalPolicyList
        metadata:
          $ref: '#/components/schemas/ListMetadata'
        items:
          type: array
          items:
            $ref: '#/components/schemas/PolicyItem'
    ListMetadata:
      type: object
      properties:
        totalCount:
          type: integer
          example: 42
        page:
          type: integer
          example: 1
        pageSize:
          type: integer
          example: 20
    PolicyItem:
      type: object
      properties:
        name:
          type: string
        namespace:
          type: string
        kind:
          type: string
          enum:
            - ApprovalPolicy
            - NotificationPolicy
            - EscalationPolicy
            - IncidentSLA
        creationTimestamp:
          type: string
          format: date-time
        spec:
          type: object
          additionalProperties: true
          description: The CRD spec, unchanged.
        status:
          type: object
          additionalProperties: true
          description: The CRD status, unchanged.
    Error:
      type: object
      required:
        - apiVersion
        - kind
        - error
      properties:
        apiVersion:
          type: string
          example: v1
        kind:
          type: string
          example: Error
        error:
          oneOf:
            - type: object
              required:
                - code
                - message
              properties:
                code:
                  type: integer
                  example: 404
                message:
                  type: string
                  example: Resource not found
                details:
                  type: string
            - type: string
        code:
          type: integer
          description: Top-level code (only used by some endpoints).
          example: 400
  responses:
    Unauthorized:
      description: Missing or invalid API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded for this token's role
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Bearer token issued by the operator. Format: `Authorization: Bearer
        <token>`.

````