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

# Get attachment download URL

> Get a short-lived presigned download URL for a task or comment attachment. Returns the URL plus filename and content type - not the file bytes. For target 'task', pass task_id.



## OpenAPI

````yaml https://mcp.agent.writesonic.com/openapi.json post /api/v1/business/attachments/download-url
openapi: 3.1.0
info:
  title: hq-backend — Business API
  description: Public business tool endpoints (API-key auth).
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/business/attachments/download-url:
    post:
      tags:
        - business
      summary: Get attachment download URL
      description: >-
        Get a short-lived presigned download URL for a task or comment
        attachment. Returns the URL plus filename and content type - not the
        file bytes. For target 'task', pass task_id.
      operationId: download_attachment_api_v1_business_attachments_download_url_post
      parameters:
        - name: x-project-id
          in: header
          required: true
          schema:
            type: string
            format: uuid
            description: Project ID for tenant scoping
            title: X-Project-Id
          description: Project ID for tenant scoping
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Overrides the key's workspace
            title: X-Workspace-Id
          description: Overrides the key's workspace
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: User API key
            title: X-Api-Key
          description: User API key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DownloadAttachmentArgs'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentDownload'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DownloadAttachmentArgs:
      properties:
        target:
          $ref: '#/components/schemas/AttachmentTarget'
          description: Whether the attachment hangs off a task or a comment
        attachment_id:
          type: string
          format: uuid
          title: Attachment Id
          description: Attachment id to fetch a download URL for
        task_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Task Id
          description: Owning task id; required when target is 'task'
      type: object
      required:
        - target
        - attachment_id
      title: DownloadAttachmentArgs
    AttachmentDownload:
      properties:
        url:
          type: string
          title: Url
        filename:
          type: string
          title: Filename
        content_type:
          type: string
          title: Content Type
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - url
        - filename
        - content_type
        - expires_at
      title: AttachmentDownload
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AttachmentTarget:
      type: string
      enum:
        - task
        - comment
      title: AttachmentTarget
    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

````