> ## 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 PostMortems

> Retorna a lista de postmortems gerados automaticamente pela plataforma

<ParamField query="incident" type="string">
  Filtrar por incidente associado (ex: `INC-20260319-001`)
</ParamField>

<ParamField query="severity" type="string">
  Filtrar por severidade do incidente original: `critical`, `high`, `medium`, `low`
</ParamField>

<ParamField query="since" type="string">
  Filtrar postmortems criados a partir de uma data ISO 8601
</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 (máximo 100)
</ParamField>

<ResponseExample>
  ```json Response 200 theme={"system"}
  {
    "apiVersion": "v1",
    "kind": "PostMortemList",
    "metadata": {
      "totalCount": 15,
      "page": 1,
      "pageSize": 20
    },
    "items": [
      {
        "name": "PM-20260318-001",
        "incident": "INC-20260318-003",
        "title": "OOMKill recorrente no checkout-service",
        "severity": "critical",
        "duration": "45m",
        "impact": "3.2% de requests falharam no checkout durante 45 minutos",
        "rootCause": "Memory leak no handler de webhook de pagamento",
        "status": "published",
        "createdAt": "2026-03-18T23:00:00Z",
        "author": "ai-generated"
      },
      {
        "name": "PM-20260317-001",
        "incident": "INC-20260317-001",
        "title": "Latência elevada no api-gateway",
        "severity": "high",
        "duration": "20m",
        "impact": "P99 latência subiu de 150ms para 2.3s",
        "rootCause": "Connection pool exaurido por queries lentas no PostgreSQL",
        "status": "published",
        "createdAt": "2026-03-17T18:30:00Z",
        "author": "ai-generated"
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /postmortems
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: Health
    description: Liveness and readiness probes.
paths:
  /postmortems:
    get:
      tags:
        - Postmortems
      summary: List Postmortems
      description: Returns the list of postmortems generated by the platform.
      operationId: listPostmortems
      parameters:
        - name: incident
          in: query
          required: false
          description: Filter by associated incident.
          schema:
            type: string
        - name: severity
          in: query
          required: false
          description: Filter by severity of the originating incident.
          schema:
            type: string
            enum:
              - critical
              - high
              - medium
              - low
        - name: since
          in: query
          required: false
          description: ISO 8601 timestamp filter.
          schema:
            type: string
            format: date-time
        - name: page
          in: query
          required: false
          description: Page number.
          schema:
            type: integer
            default: 1
        - name: pageSize
          in: query
          required: false
          description: Items per page (max 100).
          schema:
            type: integer
            default: 20
            maximum: 100
      responses:
        '200':
          description: Paginated list of postmortems
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostMortemList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    PostMortemList:
      type: object
      properties:
        apiVersion:
          type: string
          example: v1
        kind:
          type: string
          example: PostMortemList
        metadata:
          $ref: '#/components/schemas/ListMetadata'
        items:
          type: array
          items:
            $ref: '#/components/schemas/PostMortemListItem'
    ListMetadata:
      type: object
      properties:
        totalCount:
          type: integer
          example: 42
        page:
          type: integer
          example: 1
        pageSize:
          type: integer
          example: 20
    PostMortemListItem:
      type: object
      properties:
        name:
          type: string
        incident:
          type: string
        title:
          type: string
        severity:
          type: string
        duration:
          type: string
        impact:
          type: string
        rootCause:
          type: string
        status:
          type: string
          example: published
        createdAt:
          type: string
          format: date-time
        author:
          type: string
        requiresHumanAction:
          type: boolean
          description: >-
            Marks PostMortems pending a human follow-up after a Contained
            incident. Read from status (GAP-07 fix moved the field from Spec).
        requiredAction:
          type: string
          description: >-
            Concrete action a human needs to take to fully resolve the incident.
            Read from status (GAP-07 fix).
        chaosInduced:
          type: boolean
          description: True for PostMortems generated from chaos drills. GAP-04 fix.
        chaosExperiment:
          type: string
          description: Name of the ChaosExperiment CR when chaosInduced=true. GAP-04 fix.
    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>`.

````