# Retrieve filing attachments by download type

Source: https://developer.avalara.com/products/returns/integration-guides/managed-returns/keq4503697413576/

Guide: Avalara Managed Returns API (U.S. and Canada)

# Retrieve filing attachments by download type

Learn how to retrieve filing-related documents for a company and filing period by specifying the download type.

After reviewing and reconciling return data, you may need to retrieve supporting filing documents such as return confirmations or transaction trace files. This operation lets you retrieve these documents for a specific company and filing period.

## When to use this operation

Use this operation when you need to:

-   Retrieve return confirmation files for filed returns

-   Retrieve trace files that contain transaction details

-   Retrieve both confirmation files and trace files together in a single ZIP file

## **Download type options**

Use the `downloadType` field to control which filing-related documents are included in the response. This helps you retrieve only the files you need or combine multiple file types into a single request.

Set `downloadType` to one of the following values:

-   `ReturnConfirmations`: Retrieve only return confirmation files
-   `Tracefiles`: Retrieve only trace files
-   `All`: Retrieve both return confirmation files and trace files in a single ZIP file

**View request**:

```
query FilingAttachmentsByDownloadType {
  filingAttachmentsByDownloadType(
    companyId: 9327743,
    year: 2025,
    month: 3,
    downloadType: ALL )
}
```

**View response**:

```
{
  "data": {
    "filingAttachmentsByDownloadType": {
      "url": "https://s3.amazonaws.com/avalara-filings/attachments/12345/2024-03/confirmations.zip?X-Amz-Signature=abc123&X-Amz-Expires=3600",
      "fileName": "return-confirmations-12345-2024-03.zip",
      "contentType": "application/zip",
      "sizeBytes": 204800,
      "expiresAt": "2024-03-15T18:00:00Z"
    }
  }
}
```

-   `url`: Specifies the presigned download URL for the attachment archive.
-   `fileName`: Specifies the generated ZIP file name.
-   `contentType`: Specifies the MIME type of the returned file.
-   `sizeBytes`: Specifies the file size in bytes.
-   `expiresAt`: Specifies the timestamp when the download URL expires.