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

# Approve a shelf

> Transition a shelf from review to ready status. Optionally apply file operations (rename, delete, mkdir, write) before finalizing.



## OpenAPI

````yaml openapi.yaml post /v1/shelves/{id}/approve
openapi: 3.1.0
info:
  description: >-
    Convert documents into structured Markdown filesystems that AI agents can
    hydrate and use in sandbox runtimes.
  title: Shelv API
  version: 1.0.0
servers:
  - url: https://api.shelv.dev
security:
  - bearerApiKey: []
paths:
  /v1/shelves/{id}/approve:
    post:
      tags:
        - Shelves
      summary: Approve a shelf
      description: >-
        Transition a shelf from review to ready status. Optionally apply file
        operations (rename, delete, mkdir, write) before finalizing.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            $ref: '#/components/schemas/ShelfPublicIdParam'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                operations:
                  items:
                    properties:
                      content:
                        type: string
                      from:
                        type: string
                      path:
                        type: string
                      to:
                        type: string
                      type:
                        enum:
                          - rename
                          - delete
                          - mkdir
                          - write
                        type: string
                    required:
                      - type
                    type: object
                  type: array
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShelfResponse'
          description: Shelf approved and ready
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Shelf not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Shelf is not in review state
      security:
        - bearerApiKey: []
components:
  schemas:
    ShelfPublicIdParam:
      pattern: ^shf_[0-9a-f]{24}$
      type: string
    ShelfResponse:
      properties:
        auditFindings:
          items:
            properties:
              check:
                enum:
                  - naming
                  - file-size
                  - content
                  - structural
                type: string
              code:
                type: string
              file:
                type: string
              message:
                type: string
              severity:
                enum:
                  - error
                  - review
                  - warning
                type: string
              sourceRef:
                type: string
            required:
              - check
              - severity
              - message
            type: object
          type:
            - array
            - 'null'
        auditStatus:
          enum:
            - passed
            - repaired
            - review_required
          type:
            - string
            - 'null'
        auditSummary:
          type:
            - string
            - 'null'
        createdAt:
          format: date-time
          type: string
        currentVersionNumber:
          exclusiveMinimum: 0
          type:
            - integer
            - 'null'
        errorMessage:
          type:
            - string
            - 'null'
        failedAtStep:
          type:
            - string
            - 'null'
        mimeType:
          type: string
        name:
          type: string
        originalFileName:
          type: string
        pageCount:
          type:
            - number
            - 'null'
        publicId:
          pattern: ^shf_[0-9a-f]{24}$
          type: string
        quality:
          properties:
            fallbackApplied:
              type: boolean
            granularity:
              enum:
                - document
                - major_section
                - numbered_unit
                - subsection
              type:
                - string
                - 'null'
            mode:
              enum:
                - balanced
                - strict
                - best_effort
              type: string
            tier:
              enum:
                - full
                - degraded
              type:
                - string
                - 'null'
          required:
            - mode
            - tier
            - granularity
            - fallbackApplied
          type: object
        repairAttempts:
          minimum: 0
          type:
            - integer
            - 'null'
        reviewMode:
          type: boolean
        status:
          enum:
            - uploading
            - parsing
            - structuring
            - verifying
            - review
            - ready
            - failed
          type: string
        storageSizeBytes:
          type:
            - number
            - 'null'
        template:
          type:
            - string
            - 'null'
        updatedAt:
          format: date-time
          type: string
        userId:
          type: string
      required:
        - publicId
        - userId
        - name
        - status
        - template
        - pageCount
        - storageSizeBytes
        - originalFileName
        - mimeType
        - errorMessage
        - failedAtStep
        - reviewMode
        - quality
        - auditStatus
        - auditSummary
        - auditFindings
        - repairAttempts
        - currentVersionNumber
        - createdAt
        - updatedAt
      type: object
    ErrorResponse:
      properties:
        code:
          type: string
        details: {}
        message:
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    bearerApiKey:
      bearerFormat: APIKey
      scheme: bearer
      type: http

````