# Download an optimized file

Downloads the optimized file as an attachment, a PNG for an image or an MP4 for a video. Needs no key, so the link can be passed on until expires_at.

`GET https://realpng.com/api/v1/optimize/{id}/file`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string, uuid | Yes |  |

## Responses

### 200

The optimized image

### 302

A video, at its storage link in the Location header

### 404

not_found: no optimization with that id, it expired, or it has not succeeded yet. unknown_job: the optimization expired.

### default

A problem, with a stable code

Every error has a `code` and a `message`, listed on [Errors](/docs/errors).
