# Download

Access presigned URLs for downloading input or processed images. These endpoints allow you to securely retrieve the input or the processed image with an expiring URL.

## Download Output

> A presigned download link to the image is provided in the response, as well as an expiration time (in Unix time). If the image is not ready, this request will fail with a conflict error. Images are stored for \*\*7 days\*\* after the image has been processed.<br>

```json
{"openapi":"3.1.2","info":{"title":"Image API","version":"1.2.0"},"tags":[{"name":"Download","description":"Access presigned URLs for downloading input or processed images. These endpoints allow you to securely retrieve the input or the processed image with an expiring URL.\n"}],"servers":[{"url":"https://api.topazlabs.com/image/v1","description":"Production Base URL"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Authentication via the Topaz generated key in the `X-API-Key` header.\n"}},"schemas":{"DownloadResponse":{"type":"object","required":["head_url","download_url","expiry"],"properties":{"download_url":{"type":"string","description":"The presigned URL for downloading the image. This URL is temporary and will **expire after 1 hour**."},"head_url":{"type":"string","description":"The presigned URL for fetching the metadata of the image's file. Useful for retrieving the image's size before download. This URL is temporary and will **expire after 1 hour**."},"expiry":{"type":"integer","description":"The expiration time (in Unix epoch) of the presigned download link, set as 1 hour after download link generation. After this time, the link will no longer be valid."}}}},"responses":{"BadRequestProcess":{"description":"The request contains malformed data in the body, path, or query parameters.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Unauthorized":{"description":"Authentication is required and has failed or has not yet been provided.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Forbidden":{"description":"The API key doesn't have permissions to perform the request.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"NotFound":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Conflict":{"description":"The request conflicts with the current state.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"TooManyRequests":{"description":"Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"InternalServerError":{"description":"Unexpected error on our end.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}}}},"paths":{"/download/{process_id}":{"get":{"tags":["Download"],"summary":"Download Output","operationId":"getDownloadOutput","description":"A presigned download link to the image is provided in the response, as well as an expiration time (in Unix time). If the image is not ready, this request will fail with a conflict error. Images are stored for **7 days** after the image has been processed.\n","parameters":[{"name":"process_id","in":"path","required":true,"description":"The UUID of the image processing job.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Presigned download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadResponse"}}}},"400":{"$ref":"#/components/responses/BadRequestProcess"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```

## Download Input

> A presigned download link to the input image is provided in the response, as well as an expiration time (in Unix time). Input images are stored for \*\*7 days\*\* after the image has been uploaded.<br>

```json
{"openapi":"3.1.2","info":{"title":"Image API","version":"1.2.0"},"tags":[{"name":"Download","description":"Access presigned URLs for downloading input or processed images. These endpoints allow you to securely retrieve the input or the processed image with an expiring URL.\n"}],"servers":[{"url":"https://api.topazlabs.com/image/v1","description":"Production Base URL"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Authentication via the Topaz generated key in the `X-API-Key` header.\n"}},"schemas":{"DownloadResponse":{"type":"object","required":["head_url","download_url","expiry"],"properties":{"download_url":{"type":"string","description":"The presigned URL for downloading the image. This URL is temporary and will **expire after 1 hour**."},"head_url":{"type":"string","description":"The presigned URL for fetching the metadata of the image's file. Useful for retrieving the image's size before download. This URL is temporary and will **expire after 1 hour**."},"expiry":{"type":"integer","description":"The expiration time (in Unix epoch) of the presigned download link, set as 1 hour after download link generation. After this time, the link will no longer be valid."}}}},"responses":{"BadRequestProcess":{"description":"The request contains malformed data in the body, path, or query parameters.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Unauthorized":{"description":"Authentication is required and has failed or has not yet been provided.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Forbidden":{"description":"The API key doesn't have permissions to perform the request.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"NotFound":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"TooManyRequests":{"description":"Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"InternalServerError":{"description":"Unexpected error on our end.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}}}},"paths":{"/download/input/{process_id}":{"get":{"tags":["Download"],"summary":"Download Input","operationId":"getDownloadInput","description":"A presigned download link to the input image is provided in the response, as well as an expiration time (in Unix time). Input images are stored for **7 days** after the image has been uploaded.\n","parameters":[{"name":"process_id","in":"path","required":true,"description":"The UUID of the image processing job.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Presigned download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadResponse"}}}},"400":{"$ref":"#/components/responses/BadRequestProcess"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```
