> ## 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.

# Get a single file from a version

> Get the content of a single file from a specific version by its relative path. Content-Type is `text/markdown` for `.md` files, `application/json` for `.json` files, or `text/plain` otherwise.



## OpenAPI

````yaml openapi.yaml get /v1/shelves/{id}/versions/{version}/files/{filePath}
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}/versions/{version}/files/{filePath}:
    get:
      tags:
        - Shelves
      summary: Get a single file from a version
      description: >-
        Get the content of a single file from a specific version by its relative
        path. Content-Type is `text/markdown` for `.md` files,
        `application/json` for `.json` files, or `text/plain` otherwise.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            $ref: '#/components/schemas/ShelfPublicIdParam'
        - in: path
          name: version
          required: true
          schema:
            description: Version number
            exclusiveMinimum: 0
            type: integer
        - in: path
          name: filePath
          required: true
          schema:
            description: Relative file path within the shelf (may contain slashes)
            example: chapter-1/section-1.md
            type: string
      responses:
        '200':
          content:
            text/plain:
              schema:
                type: string
          description: File content
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Shelf, version, or file not found
      security:
        - bearerApiKey: []
components:
  schemas:
    ShelfPublicIdParam:
      pattern: ^shf_[0-9a-f]{24}$
      type: string
    ErrorResponse:
      properties:
        code:
          type: string
        details: {}
        message:
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    bearerApiKey:
      bearerFormat: APIKey
      scheme: bearer
      type: http

````