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

# Approve or reject a tool call

> Decide a waiting approval. Approving lets the call through, with
`args` in place of the agent's own if given. Rejecting refuses it and
tells the agent why; the run carries on without that call. Only whoever
started the run, the crew's owner or a crew admin may decide.



## OpenAPI

````yaml post /api/crew-runs/{run_id}/approvals/{approval_id}
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/crew-runs/{run_id}/approvals/{approval_id}:
    post:
      tags:
        - Crew runs
      summary: Approve or reject a tool call
      description: |-
        Decide a waiting approval. Approving lets the call through, with
        `args` in place of the agent's own if given. Rejecting refuses it and
        tells the agent why; the run carries on without that call. Only whoever
        started the run, the crew's owner or a crew admin may decide.
      operationId: decide_approval_api_crew_runs__run_id__approvals__approval_id__post
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of the run record.
            title: Run Id
          description: ID of the run record.
        - name: approval_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of the approval.
            title: Approval Id
          description: ID of the approval.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalDecision'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api__models__crew_models__ApprovalResponse
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Already decided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    ApprovalDecision:
      properties:
        decision:
          type: string
          enum:
            - approve
            - reject
          title: Decision
        reason:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Reason
          description: Why, when rejecting.
        args:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Args
          description: >-
            Approve with these arguments instead of the ones the agent sent.
            Only with `approve`, and only for a tool call.
      type: object
      required:
        - decision
      title: ApprovalDecision
      description: Approve or reject a waiting tool call.
    api__models__crew_models__ApprovalResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        run_id:
          type: string
          format: uuid
          title: Run Id
        kind:
          type: string
          title: Kind
          description: '`tool`, or `checkpoint` before a task.'
        tool:
          type: string
          title: Tool
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        args:
          title: Args
          description: The call's arguments, masked.
        requested_at:
          type: string
          format: date-time
          title: Requested At
        decision:
          anyOf:
            - type: string
            - type: 'null'
          title: Decision
          description: '`approved`, `rejected` or `expired`. Null while waiting.'
        decided_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Decided By
        decided_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Decided At
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        edited:
          type: boolean
          title: Edited
          description: The approver changed the call's arguments.
          default: false
        source:
          type: string
          title: Source
          description: '`person`, or `schedule` for a pre-approval.'
        can_decide:
          type: boolean
          title: Can Decide
          description: Whether the caller may decide this one.
          default: false
      type: object
      required:
        - id
        - run_id
        - kind
        - tool
        - requested_at
        - source
      title: ApprovalResponse
      description: A request for approval during a run, and its decision if it has one.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.