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

# Rejeitar Solicitacao

> Rejeita uma solicitacao pendente, impedindo a execução da remediação

<ParamField path="name" type="string" required>
  Nome único da aprovação (ex: `APR-20260319-001`)
</ParamField>

<ParamField body="rejectedBy" type="string" required>
  Identificador do usuário que está rejeitando
</ParamField>

<ParamField body="reason" type="string" required>
  Motivo da rejeicao
</ParamField>

<ResponseExample>
  ```json Response 200 theme={"system"}
  {
    "apiVersion": "v1",
    "kind": "Approval",
    "metadata": {
      "name": "APR-20260319-001",
      "namespace": "production"
    },
    "status": {
      "status": "rejected",
      "rejectedBy": "ana.costa@empresa.com",
      "rejectedAt": "2026-03-19T15:40:00Z",
      "reason": "Preferimos resolver com HPA antes de aumentar limits. Vamos ajustar o autoscaling primeiro.",
      "incident": "INC-20260319-001",
      "remediationTriggered": false
    }
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json Response 409 theme={"system"}
  {
    "apiVersion": "v1",
    "kind": "Error",
    "error": {
      "code": 409,
      "message": "Aprovação já decidida",
      "details": "A aprovação 'APR-20260319-001' já foi rejeitada por ana.costa@empresa.com em 2026-03-19T15:40:00Z"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /approvals/{name}/reject
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:
  /approvals/{name}/reject:
    post:
      tags:
        - Approvals
      summary: Reject Request
      description: Rejects a pending approval request, blocking the remediation.
      operationId: reject
      parameters:
        - name: name
          in: path
          required: true
          description: Unique approval name.
          schema:
            type: string
            example: APR-20260319-001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rejectedBy
                - reason
              properties:
                rejectedBy:
                  type: string
                  description: User identifier rejecting.
                  example: ana.costa@empresa.com
                reason:
                  type: string
                  description: Reason for rejection.
                  example: Prefer adjusting HPA before raising limits.
            example:
              rejectedBy: ana.costa@empresa.com
              reason: Prefer adjusting HPA before raising limits.
      responses:
        '200':
          description: Approval rejected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Approval'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Approval:
      type: object
      properties:
        apiVersion:
          type: string
          example: v1
        kind:
          type: string
          example: Approval
        metadata:
          type: object
          properties:
            name:
              type: string
            namespace:
              type: string
            createdAt:
              type: string
              format: date-time
        spec:
          type: object
          properties:
            issueRef:
              type: string
            remediationPlanRef:
              type: string
            action:
              type: string
            targetResource:
              type: object
              properties:
                kind:
                  type: string
                name:
                  type: string
                namespace:
                  type: string
            confidence:
              type: number
            severity:
              type: string
            mode:
              type: string
            blastRadius:
              type: object
              properties:
                riskLevel:
                  type: string
                affectedPods:
                  type: integer
                affectedServices:
                  type: array
                  items:
                    type: string
                warnings:
                  type: array
                  items:
                    type: string
        status:
          type: object
          properties:
            state:
              type: string
            status:
              type: string
            createdAt:
              type: string
              format: date-time
            expiresAt:
              type: string
              format: date-time
            approvedBy:
              type: string
            approvedAt:
              type: string
              format: date-time
            rejectedBy:
              type: string
            rejectedAt:
              type: string
              format: date-time
            comment:
              type: string
            reason:
              type: string
            incident:
              type: string
            remediationTriggered:
              type: boolean
    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'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: Conflict with current state of the resource
      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>`.

````