# Download file (attachment / property)

`GET /api/file/{hash}/{download}`

URL: https://repsona.com/api/get-file-hash-download

download=attachment stream, property=file metadata JSON. url mode is not supported (400).

## Parameters

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `hash` | path | string | required | Hash of the file (UUID), returned as `hash` when the file was uploaded. |
| `download` | path | download \| property \| url | required | `download` returns the file as an attachment, `property` returns its metadata as JSON. `url` is not supported and returns 400. |

## Request

```sh
curl -X GET "https://<space>.repsona.com/api/file/{hash}/{download}" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## Responses

- 200: File stream or metadata
- 206: Partial content (Range)
- 400: url mode is not supported
- 401: Authentication is required
- 403: Not a member of the file's project
- 404: File not found

## Example response

```json
{
  "file": {
    "id": 60,
    "hash": "a77661cf-f741-4981-af91-362572c5e0b4",
    "size": 68,
    "type": "image/png",
    "filename": "screenshot.png",
    "projectId": null,
    "createdAt": 1793662652069
  }
}
```
