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

# Get download url for a file

> Returns a presigned download URL for the current version of the file, or for a specific version when 'versionId' is supplied.
The URL is valid for 1 hour. The response 'Content-Disposition' uses the file name and extension.



## OpenAPI

````yaml /openapi.json get /matters/{matterId}/documents/files/{fileId}/download
openapi: 3.0.1
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.smokeball.com
  - url: https://api.smokeball.com.au
  - url: https://api.smokeball.co.uk
  - url: https://stagingapi.smokeball.com
  - url: https://stagingapi.smokeball.com.au
  - url: https://stagingapi.smokeball.co.uk
security:
  - api-key: []
    token: []
paths:
  /matters/{matterId}/documents/files/{fileId}/download:
    get:
      tags:
        - Files
      summary: Get download url for a file
      description: "Returns a presigned download URL for the current version of the file, or for a specific version when 'versionId' is supplied.\r\nThe URL is valid for 1 hour. The response 'Content-Disposition' uses the file name and extension."
      operationId: DownloadFile
      parameters:
        - name: matterId
          in: path
          description: Unique identifier (GUID) of the matter.
          required: true
          schema:
            type: string
        - name: fileId
          in: path
          description: Unique identifier (GUID) of the file.
          required: true
          schema:
            type: string
        - name: versionId
          in: query
          description: >-
            Optional. Unique identifier of the file version to download. Must be
            a version of this file. Defaults to the current version.
          schema:
            type: string
      responses:
        '200':
          description: When request is successful. Returns a 'DownloadFileInfo' object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadFileInfo'
        '400':
          description: >-
            When a supplied id is not a valid GUID, or when 'versionId' is not a
            version of this file ("Provided invalid versionId").
          content:
            application/json:
              schema:
                type: string
        '403':
          description: >-
            When the requested file does not belong to the account making the
            request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: >-
            When the file does not exist, does not belong to the specified
            matter, or has no uploaded version yet.
          content:
            application/json:
              schema:
                type: string
components:
  schemas:
    DownloadFileInfo:
      type: object
      properties:
        fileId:
          type: string
          description: Unique identifier of the requested file
          nullable: true
          example: b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2
        name:
          type: string
          description: Name of the file, excluding file extension.
          nullable: true
          example: court filing
        fileExtension:
          type: string
          description: Extension of the file.
          nullable: true
          example: .pdf
        downloadUrl:
          type: string
          description: >-
            Temporary presigned URL to download the file content with an HTTP
            GET request. Valid for 1 hour from the time of the API call (see
            Expiry).
          nullable: true
          example: >-
            https://example-bucket.s3.amazonaws.com/files/2f1c9a3e-6b1d-4c7e-9a0f-1d2e3f4a5b6c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=...
        expiry:
          type: string
          description: >-
            UTC date/time when the download link is no longer accessible (1 hour
            after issue)
          format: date-time
          example: '2022-04-23T14:30:00Z'
        sizeBytes:
          type: integer
          description: >-
            Size of the content behind DownloadUrl (in bytes). For the extracted
            text endpoint this is the size of the extracted text, not of the
            original file.
          format: int64
          example: 19104768
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header
    token:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools

````

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