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

# Get a temporary original-file download

> Returns a fresh presigned URL for the authorized original file. The URL expires at data.expiresAt. This operation is separate from document_read so reading representations never downloads the full file implicitly.




## OpenAPI

````yaml /openapi/tools-v1.yaml get /api/tools/v1/documents/download
openapi: 3.1.0
info:
  title: Govly Tools API (Alpha)
  version: 1.0.0-alpha
  description: >
    ALPHA / UNSTABLE: This API is still in active development. Endpoint
    behavior, request fields, response fields, error codes, and operation names
    may change before the Tools API is declared stable.

    REST-callable tool surface for agent and automation workflows. Agents are
    the primary consumer, but integrations can be built on this API. Responses
    are JSON for typed clients; MCP tools may render action results into
    text-oriented formats separately.
servers:
  - url: https://app.govly.com
security:
  - bearerApiKey: []
  - headerApiKey: []
tags:
  - name: Opportunities
    description: Search, fetch, and inspect Govly opportunity records.
  - name: Awards
    description: Search and inspect awarded government contracts.
  - name: Workspaces
    description: Create, update, and inspect opportunity workspaces.
  - name: Workspace Members
    description: Add users and teams to workspaces.
  - name: Workspace Attachments
    description: List and upload workspace attachments.
  - name: Workspace Comments
    description: Post comments to workspaces.
  - name: Follows
    description: Follow opportunities and related workspace activity.
  - name: Saved Searches
    description: List saved opportunity searches and cached matches.
  - name: Documents
    description: >-
      Read document representations and request temporary original-file
      downloads.
  - name: Quote Submissions
    description: >-
      Inspect quote submission requirements, submit quotes, and poll submission
      status.
  - name: Inbox
    description: Read and triage the authenticated user's matched inbox items.
paths:
  /api/tools/v1/documents/download:
    get:
      tags:
        - Documents
      summary: Get a temporary original-file download
      description: >
        Returns a fresh presigned URL for the authorized original file. The URL
        expires at data.expiresAt. This operation is separate from document_read
        so reading representations never downloads the full file implicitly.
      operationId: document_download
      parameters:
        - name: documentType
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/DocumentType'
        - name: id
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Temporary original-file download descriptor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentDownloadEnvelope'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
components:
  schemas:
    DocumentType:
      type: string
      enum:
        - opportunity_attachment
        - workspace_attachment
        - session_attachment
        - document
    DocumentDownloadEnvelope:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/DocumentDownload'
    DocumentDownload:
      type: object
      required:
        - id
        - documentType
        - filename
        - url
        - expiresAt
      properties:
        id:
          type: string
        documentType:
          $ref: '#/components/schemas/DocumentType'
        filename:
          type: string
        contentType:
          type: string
        byteSize:
          type: integer
        url:
          type: string
          format: uri
          description: Temporary presigned URL for the original file.
        expiresAt:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - status
              - code
              - title
              - detail
            properties:
              status:
                type: string
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: API key
    headerApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````