# Download original files

### Download uploaded files

Alphamoon REST API enables you to download original files for specified collections. To do that, get the **collection\_id** of the processed file from:

* [Upload a file](https://alphamoon.gitbook.io/documentation/api/upload-file) endpoint (Base64 or Binary)
* Get collections endpoint
* URL\
  **e.g.** <https://workspace.alphamoon.ai/supervision/**223742cc9bca43fd81b2d41b0018e4c7>\*\*

Use the following endpoint to get the original files:

## Download original files for specified collections

<mark style="color:blue;">`GET`</mark> `/api/v0.3/collections/{collection_id}/uploaded files`

#### Path Parameters

| Name                                            | Type   | Description                                                                 |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------- |
| collection-id<mark style="color:red;">\*</mark> | String | The id of the collection for which you want to download the original files. |

{% tabs %}
{% tab title="200: OK Successful Response" %}

```json
Download file
```

{% endtab %}

{% tab title="422: Unprocessable Entity Validation Error" %}

```json
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### See the example:

{% tabs %}
{% tab title="API call" %}

```bash
curl -X 'GET' \
  'https://workspace.alphamoon.ai/api/v0.3/collections/c0da3bd0798e4549a1eb673887258dd3/uploaded_files' \
  -H 'accept: */*' \
  -H 'Authorization: Basic API_KEY_BASE64_ENCODED'
```

{% endtab %}

{% tab title="Server response" %}

```
Download file
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If a collection contains only one document, the output will retain the same format. For instance, if you upload a single PDF document, the output will also be in PDF.

On the other hand, if you upload a folder of files as a single collection, then you'll get the ZIP archive as an output.
{% endhint %}

**See next:**
