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

# Download File

> Download a file by its file string identifier.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://api.roe-ai.com/v1/datasets/files/YOUR_FILE_ID/download/" \
    --header "Authorization: Bearer YOUR_API_KEY" \
    --output downloaded_file.pdf
  ```
</RequestExample>


## OpenAPI

````yaml GET /v1/datasets/files/{file_str}/download/
openapi: 3.1.0
info:
  title: Roe AI API
  version: 1.0.0
  description: Complete API documentation for Roe AI platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /v1/datasets/files/{file_str}/download/:
    get:
      tags:
        - v1
      description: Download a file by its file string identifier.
      operationId: v1_datasets_files_download_retrieve
      parameters:
        - in: path
          name: file_str
          schema:
            type: string
          description: File string identifier (encoded file ID with optional metadata)
          required: true
        - in: query
          name: page_range
          schema:
            type: string
          description: Page range for PDF files (e.g., '1-5', '1,3,5', '1-3,5-7')
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
                format: binary
              examples:
                Example:
                  value: Binary file content
          description: File content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                InvalidFileID:
                  value:
                    error: Invalid file id
                  summary: Invalid File ID
          description: Bad request
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example:
                  value:
                    error: You don't have access because you're not on a plan
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example:
                  value:
                    error: File does not exist
          description: File not found
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message

````