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

# Download Document Source File

> Download the original file a document was extracted from (uploaded file or SharePoint file).

Available when the document's `source_file` is set. Requires the `knowledge:files:read` scope, which
`knowledge:read` and `knowledge:write` do not include. SharePoint files are fetched live, so you get the
current version even if AGO has not synced it yet.



## OpenAPI

````yaml /openapi-v1.json get /api/v1/documents/{document_id}/file
openapi: 3.1.0
info:
  title: AGO Public API
  version: 1.0.0
  description: Programmatic access to your AGO workspace.
servers:
  - url: https://{tenant_id}.api.useago.com
    description: AGO Public API v1
    variables:
      tenant_id:
        default: your-tenant-id
        description: Your AGO tenant identifier
security: []
paths:
  /api/v1/documents/{document_id}/file:
    get:
      tags:
        - Documents
      summary: Download Document Source File
      description: >-
        Download the original file a document was extracted from (uploaded file
        or SharePoint file).


        Available when the document's `source_file` is set. Requires the
        `knowledge:files:read` scope, which

        `knowledge:read` and `knowledge:write` do not include. SharePoint files
        are fetched live, so you get the

        current version even if AGO has not synced it yet.
      operationId: core_api_v1_controllers_documents_download_document_source_file
      parameters:
        - in: path
          name: document_id
          schema:
            format: uuid
            title: Document Id
            type: string
          required: true
      responses:
        '200':
          description: The original file, as an attachment.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      security:
        - ScopedAPIKeyAuth: []
components:
  securitySchemes:
    ScopedAPIKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

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