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

# Approve or reject a pending write-tool approval

> Requires a real AcornOps user with create_read_write_runs for approval. Bots may relay this decision only when they can authenticate and attribute that user.



## OpenAPI

````yaml /openapi/control-plane-public.json post /api/v1/runs/{runId}/approvals/{approvalId}/decision
openapi: 3.1.0
info:
  title: AcornOps Control Plane API
  version: 0.0.1-experimental.1
  description: >-
    Control plane API for workspaces, targets, Kubernetes clusters, virtual
    machines, sessions, runs, auth, and internal execution wiring.
servers:
  - url: https://api.acornops.dev
security: []
tags:
  - name: health
    description: Health and readiness endpoints.
  - name: auth
    description: >-
      OIDC, password, browser session, and external integration account link
      endpoints.
  - name: workspaces
    description: Workspace, target, Kubernetes cluster, and VM management endpoints.
  - name: webhooks
    description: Best-effort webhook subscription and delivery history endpoints.
  - name: sessions
    description: Session and message endpoints.
  - name: runs
    description: Run query, cancel, and stream endpoints.
  - name: workflows
    description: >-
      Workspace workflow definitions, schedules, sessions, and approval inbox
      endpoints.
  - name: agents
    description: >-
      Workspace-scoped custom agent definitions, triggers, versions, tests, and
      activity.
  - name: admin
    description: Operator-only admin API protected exclusively by admin bearer tokens.
  - name: internal
    description: Internal execution endpoints for execution-engine.
paths:
  /api/v1/runs/{runId}/approvals/{approvalId}/decision:
    post:
      tags:
        - runs
      summary: Approve or reject a pending write-tool approval
      description: >-
        Requires a real AcornOps user with create_read_write_runs for approval.
        Bots may relay this decision only when they can authenticate and
        attribute that user.
      parameters:
        - in: path
          name: runId
          required: true
          schema:
            type: string
            format: uuid
            example: 5e709a9c-2481-4baa-aec2-ca193c50167d
        - in: path
          name: approvalId
          required: true
          schema:
            type: string
            format: uuid
            example: 0f2e8f75-0d66-4f40-b3d0-f4c4661c43a1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - decision
              properties:
                decision:
                  type: string
                  enum:
                    - approved
                    - rejected
              example:
                decision: approved
      responses:
        '200':
          description: Decision recorded. Repeated identical decisions are idempotent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalDecision'
        '400':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The authenticated user cannot approve write runs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The approval was already decided, expired before the decision was
            recorded, or received a conflicting decision.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - userSession: []
components:
  schemas:
    ApprovalDecision:
      type: object
      required:
        - approval
      properties:
        approval:
          $ref: '#/components/schemas/RunApproval'
        conflict:
          type: object
          additionalProperties: true
      additionalProperties: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: object
              additionalProperties: true
              description: Optional structured error details.
    RunApproval:
      type: object
      required:
        - id
        - runId
        - status
        - targetId
        - targetType
      properties:
        id:
          type: string
          format: uuid
        runId:
          type: string
          format: uuid
        targetId:
          type: string
          format: uuid
        targetType:
          type: string
          enum:
            - kubernetes
            - virtual_machine
        clusterId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
            - expired
        toolName:
          type: string
        summary:
          type: string
          description: >-
            Human-readable, non-authoritative description of the pending write
            action.
        createdAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
        decidedAt:
          type: string
          format: date-time
      additionalProperties: true
  securitySchemes:
    userSession:
      type: apiKey
      in: cookie
      name: acornops_cp_session

````