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

# Download File

> Download a file. Requires either Bearer auth + agent ownership, or a
scoped download token bound to this `agent_id`/`filename`.



## OpenAPI

````yaml /api-reference/openapi.json get /api/files/{agent_id}/{filename}
openapi: 3.1.0
info:
  title: apowerb API
  description: REST API of the apowerb agentic framework (open-source edition).
  version: 0.1.2
  license:
    name: MIT
    url: https://github.com/apowerb/apowerb/blob/main/LICENSE
servers:
  - url: https://api.example.com
    description: Your apowerb instance
  - url: http://localhost:8000
    description: Local stack
security: []
paths:
  /api/files/{agent_id}/{filename}:
    get:
      tags:
        - files
      summary: Download File
      description: |-
        Download a file. Requires either Bearer auth + agent ownership, or a
        scoped download token bound to this `agent_id`/`filename`.
      operationId: download_file_api_files__agent_id___filename__get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: filename
          in: path
          required: true
          schema:
            type: string
            title: Filename
        - name: token
          in: query
          required: false
          schema:
            type: string
            description: Download token (alternative to Bearer auth)
            title: Token
          description: Download token (alternative to Bearer auth)
      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:
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````

## Related topics

- [Get File Content](/api-reference/onedrive-browser/get-file-content.md)
- [Index S3](/api-reference/rag/index-s3.md)
- [Tools](/concepts/tools.md)
- [Get Excel Preview](/api-reference/onedrive-browser/get-excel-preview.md)
- [Preview a OneDrive spreadsheet (xlsx/xls/xlsm/ods/csv/tsv)](/api-reference/bi-datasets/preview-a-onedrive-spreadsheet-xlsxxlsxlsmodscsvtsv.md)
