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

# Decide an approval

> Approve or reject a pending gate or tool permission.


## OpenAPI

```yaml openapi.json post /v1/companies/{campus}/approvals/{ap}
openapi: 3.1.0
info:
  title: Ocean One API
  version: 2.4.0
servers:
  - url: https://api.plungeai.com
paths:
  /v1/companies/{campus}/approvals/{ap}:
    post:
      operationId: post-v1-companies-campus-approvals-ap
      tags:
        - Companies
      summary: Decide an approval
      description: Approve or reject a pending gate. Approving a tool permission also resumes the execution that paused for it, once; that part never fails the decision (see `continue_error`). A reject leaves the execution paused. An approval that is not pending, or not yours to decide, is refused.
      security:
        - ozkBearer: []
      parameters:
        - name: campus
          in: path
          required: true
          schema:
            type: string
          description: The company’s slug (`plunge`), never a row id
        - name: ap
          in: path
          required: true
          schema:
            type: string
          description: "Approval id (from the door: GET …/approvals)"
        - name: format
          in: query
          schema:
            type: string
            enum:
              - json
              - yaml
              - markdown
              - text
          description: Response format; overrides Accept (an unknown value is 400 invalid_format)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                decision:
                  type: string
                  enum:
                    - approve
                    - reject
                note:
                  type: string
                  maxLength: 65536
              required:
                - decision
          text/yaml:
            schema:
              type: object
              properties:
                decision:
                  type: string
                  enum:
                    - approve
                    - reject
                note:
                  type: string
                  maxLength: 65536
              required:
                - decision
      responses:
        "200":
          description: The decision as recorded Response format negotiates via the `format` field, an Accept header (application/json, text/yaml, text/markdown, text/plain), or the request Content-Type mirror; default JSON.
          content:
            application/json:
              schema:
                type: object
                properties:
                  approval:
                    type: object
                    properties:
                      id:
                        type: string
                      item_id:
                        type: string
                      building:
                        type: string
                      step:
                        type: string
                      gate:
                        type: string
                      tier:
                        type:
                          - string
                          - "null"
                      status:
                        type: string
                        enum:
                          - pending
                          - approved
                          - rejected
                          - expired
                      payload_json:
                        type: string
                      execution_id:
                        type:
                          - string
                          - "null"
                        description: "For a `tool_permission` gate raised inside an office: the paused execution"
                      requested_at:
                        type: string
                      expires_at:
                        type: string
                      decided_at:
                        type:
                          - string
                          - "null"
                      decided_by:
                        type:
                          - string
                          - "null"
                        description: "`auto`, `timeout`, `user:<id>`, `team:<id>` or `node`"
                      note:
                        type:
                          - string
                          - "null"
                  execution_id:
                    type: string
                    description: "Present for a tool permission: the execution that paused for it"
                  continued:
                    type: boolean
                    description: "Present with `execution_id`: true when an approve resumed that execution. A reject leaves it paused (false, no error)"
                  continue_error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - not_paused
                          - session_expired
                          - execution_not_found
                          - continue_failed
                      message:
                        type: string
                    description: The approve was recorded but the execution could not be resumed; answer it by hand with POST /v1/executions/{id}/continue
            text/yaml:
              schema:
                type: string
            text/markdown:
              schema:
                type: string
            text/plain:
              schema:
                type: string
        "400":
          description: invalid_json — body is not valid JSON or YAML; invalid_format — format must be one of json, yaml, markdown, text
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: unauthorized — missing, invalid or revoked ozk_ key
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "company_not_found — no company with that slug for this account (a foreign slug answers the same); or no approval with that id in this company; not_found — no route for this method on this path: every other method answers it"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: the approval was already decided or expired, or is not yours to decide; nothing changed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: invalid_params — a field failed validation; nothing was written
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "502":
          description: upstream_error — the company service is unavailable; retry
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: not_enabled — the company service is not deployed on this tier
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    Error:
      type: object
      description: Standard error envelope. Every error response also carries an `X-Error-Code` response header equal to error.code, so a client branches on the header regardless of the negotiated body format (json | yaml | markdown | text). When the request created an execution, the `X-Execution-Id` response header is also set. Errors follow the negotiated format like success bodies.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            connect:
              type: object
              description: "On a 424 connection_required / credential_required: where the missing connection is made."
              properties:
                provider:
                  type: string
                method:
                  type: string
                  enum:
                    - oauth
                    - api_key
                    - wallet
                link:
                  type: string
                  example: POST /v1/connections/stripe/link
          required:
            - code
            - message
          additionalProperties: true
      required:
        - error
  securitySchemes:
    ozkBearer:
      type: http
      scheme: bearer
      description: "ozk_ platform API key (Authorization: Bearer ozk_…)"
```
