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

> ## Agent Instructions
> Typebar, formerly SuperDocs. Same product, same API, same keys: nothing changes for your integration.
> Typebar, formerly SuperDocs, is not related to SuperDoc (superdoc.dev).

# Approve or deny AI-proposed document changes one-by-one or in batch (HITL workflow).

> Decide changes held for review (chat or chat_async). Single: change_id + approved=true|false (+ optional feedback for the AI to revise on). Batch: a 'changes' array of per-change decisions. Approved changes apply atomically; denied ones are discarded. When a decision completes the batch (batch_complete=true), the job resumes and this call waits until the resumed turn settles, then returns job_status and applied: applied=true means the approved changes are in the document (an export or the next chat includes them); job_status awaiting_approval means the turn proposed more changes (decide them the same way); failed means they were not applied. With wait_for_result=false it returns at once (applied=false) and you wait with get_job.



## OpenAPI

````yaml /openapi.json post /v1/chat/{session_id}/approve
openapi: 3.1.0
info:
  title: Universal Document AI API
  description: AI-powered document editing with multi-tenant organization support
  version: 2.0.0
servers:
  - url: https://api.superdocs.app
security: []
paths:
  /v1/chat/{session_id}/approve:
    post:
      tags:
        - v1
        - mcp
        - approval
      summary: >-
        Approve or deny AI-proposed document changes one-by-one or in batch
        (HITL workflow).
      description: >-
        Decide changes held for review (chat or chat_async). Single: change_id +
        approved=true|false (+ optional feedback for the AI to revise on).
        Batch: a 'changes' array of per-change decisions. Approved changes apply
        atomically; denied ones are discarded. When a decision completes the
        batch (batch_complete=true), the job resumes and this call waits until
        the resumed turn settles, then returns job_status and applied:
        applied=true means the approved changes are in the document (an export
        or the next chat includes them); job_status awaiting_approval means the
        turn proposed more changes (decide them the same way); failed means they
        were not applied. With wait_for_result=false it returns at once
        (applied=false) and you wait with get_job.
      operationId: approve_change
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApprovalRequest:
      properties:
        job_id:
          type: string
          title: Job Id
          description: Job ID that is awaiting approval.
        change_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Change Id
          description: >-
            Specific change to approve/deny (for individual decisions). Get
            change IDs from the job's pending_changes.
        approved:
          type: boolean
          title: Approved
          description: Whether to approve (true) or deny (false) the change.
        feedback:
          anyOf:
            - type: string
            - type: 'null'
          title: Feedback
          description: >-
            Optional feedback explaining why a change was denied. Helps the AI
            adjust future suggestions.
        changes:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Changes
          description: >-
            Batch decisions: array of {change_id, approved, feedback}. Each
            listed change_id with approved=true is an explicit decision and
            applies, including changes flagged for individual review; an approve
            that names no change decides nothing and returns the flagged ids in
            needs_individual_approval.
        wait_for_result:
          type: boolean
          title: Wait For Result
          description: >-
            Default true: when the decision completes the batch, the call
            returns after the resumed turn settles (changes applied and saved, a
            new review pause, or a failure), reported in job_status, applied and
            job. false returns once the decision is recorded (applied=false,
            job_status='in_progress'); then wait with get_job.
          default: true
      type: object
      required:
        - job_id
        - approved
      title: ApprovalRequest
      description: Approve or deny proposed AI document changes.
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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