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

# Download attachment (generates signed URL and redirects)

> Generate a short-lived signed R2 URL for a note attachment with `Content-Disposition: attachment`, and 302-redirect to it. Used by the notes UI to force-download attachments rather than render inline.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/contact-notes/download
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/contact-notes/download:
    get:
      tags:
        - Contact Notes
      summary: Download attachment (generates signed URL and redirects)
      description: >-
        Generate a short-lived signed R2 URL for a note attachment with
        `Content-Disposition: attachment`, and 302-redirect to it. Used by the
        notes UI to force-download attachments rather than render inline.
      operationId: download_attachment
      parameters:
        - in: query
          name: key
          required: true
          schema:
            type: string
        - in: query
          name: fileName
          required: false
          schema:
            type: string
      responses:
        '302':
          description: >-
            Redirect to the signed download URL. The signed URL has
            `Content-Disposition: attachment` so the browser downloads the file.
          headers:
            Location:
              description: Signed object-storage URL (R2). Time-limited to ~1 hour.
              schema:
                type: string
                format: uri
        '400':
          description: Storage key is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactNotesErrorResponse'
        '500':
          description: Failed to generate download URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactNotesErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ContactNotesErrorResponse:
      type: object
      description: >-
        Error envelope returned by contact-notes endpoints. May include `error`
        (raw exception message) on 500 paths.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
      additionalProperties: true
      example:
        success: false
        message: Contact note not found
        error: NOT_FOUND
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````