API version: 0.3.0

---

# GET /\<uuid>/file — Get element file

Returns the binary file attached to an element as a stream, together with a `Content-Disposition` header describing
the original filename.

The filename is built from the element's `name` property, if it has one and it is a string, falling back to the
element's id otherwise. The extension is taken from the file that was actually uploaded (see
[`POST /<uuid>/file`](/api/post-element-file.md)), or `bin` if none could be determined.

> **ℹ Info**
>
> Returns `404` both when the element does not exist (or is not accessible to the current user) and when the
> element exists but has no file attached - the two cases cannot be told apart from the response alone.

Like most other element endpoints, this endpoint supports conditional requests via `If-Match` and `If-None-Match`,
using an `ETag` derived from the file's content. `If-Match: *` and `If-None-Match: *` are supported; `If-Match` on an
element without file answers `412`, and without the required access conditional requests answer `403` (element readable)
or `404` (element not readable).

The response also carries a `Repr-Digest` header with the file's SHA-256 hash, in
[RFC 9530](https://datatracker.ietf.org/doc/html/rfc9530) structured-field format (`sha-256=:[base64]:`), letting the
client verify the download's integrity without a separate request. It is omitted for files uploaded before this
header existed, since no hash was stored for them yet.

## Partial downloads with `Range`

This endpoint accepts a `Range` header to download part of a file instead of the whole thing, e.g. to resume an
interrupted download or stream a large file. See the
[file reference](/reference/elements/file.md#partial-downloads-with-range) for the exact supported syntax and error cases,
or the [managing big files guide](/guide/managing-big-files.md#downloading-part-of-a-file) for a worked example.

A satisfiable range responds with `206 Partial Content` and a `Content-Range` header describing what was returned. An
end beyond the file's actual length is clamped rather than rejected. `Accept-Ranges: bytes` is always present, even on
a full, non-ranged response, so clients can detect range support ahead of time.

> **⚠ Note**
>
> Only a single range is supported - `bytes=[start]-[end]`, `bytes=[start]-` or `bytes=-[suffixLength]`, e.g.
> `bytes=0-1048575` for the first megabyte. A comma-separated list of ranges fails with `400 Bad Request`. A range
> whose start is beyond the end of the file, or that spans zero bytes, fails with `416 Range Not Satisfiable` (any
> range on a zero-byte file too).

## Request

```bash
curl \
  -H 'Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc' \
  https://api.example.com/02IiNr0GOoKiPMM1keIQn6X4HCRG6E9xAcDJ9/file
```

## Response

### 200 · OK

File found and returned as a stream. No `Range` header was sent, so the complete file is returned.

#### Body

_binary response / raw file_

#### Headers

```http
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-Match
Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag
Accept-Ranges: bytes
Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT
Cache-Control: no-cache, private
Content-Disposition: attachment; filename=image.jpg
ETag: "YgbFC4u5EgC"
Repr-Digest: sha-256=:X4a4pOezhox2tI5PXW8UAd7NAdOKPjE3wYlYs+eTt7Y=:
X-Powered-By: Ember Nexus API
```

#### Schema

```json
{
  "type": "string",
  "format": "binary"
}
```

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/200) · [HTTP.dev](https://http.dev/200)

### 206 · Partial Content

Partial file content returned, matching the requested `Range`. The end of an open-ended or overlong range is clamped to the file's actual length rather than rejected.

#### Body

_binary response / raw file_

#### Headers

```http
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-Match
Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag
Accept-Ranges: bytes
Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT
Cache-Control: no-cache, private
Content-Disposition: attachment; filename=image.jpg
Content-Range: bytes 0-99/138937
ETag: "YgbFC4u5EgC"
Repr-Digest: sha-256=:X4a4pOezhox2tI5PXW8UAd7NAdOKPjE3wYlYs+eTt7Y=:
X-Powered-By: Ember Nexus API
```

#### Schema

```json
{
  "type": "string",
  "format": "binary"
}
```

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/206) · [HTTP.dev](https://http.dev/206)

### 304 · Not Modified

Not modified. Returned when `If-None-Match` header matches current `ETag`.

#### Headers

```http
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-Match
Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag
Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT
Cache-Control: no-cache, private
ETag: "YgbFC4u5EgC"
X-Powered-By: Ember Nexus API
```

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/304) · [HTTP.dev](https://http.dev/304)

### 400 · Bad Request

The `Range` header could not be parsed, or requests more than one range.

#### Body

```json
{
  "type": "https://api.example.com/error/400/bad-content",
  "title": "Bad content",
  "status": 400,
  "instance": "urn:uuid:02IiNr0G8viOVKjLCfR4NIEdgVrLpaxVcZ7BI",
  "detail": "Could not parse 'Range' header: 'bytes=not-a-valid-range'. Only a single range of the form 'bytes=<start>-<end>', 'bytes=<start>-' or 'bytes=-<suffixLength>' is supported."
}
```

#### Headers

`Access-Control-Allow-Headers`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin`, `Access-Control-Expose-Headers`, `Allow`, `Cache-Control`, `X-Powered-By`. Descriptions and example values are in the Response Header section below.

#### Schema

Same as `Problem` — see the Response Schema section below.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400) · [HTTP.dev](https://http.dev/400)

### 401 · Unauthorized

The provided token is either invalid or expired.

#### Body

```json
{
  "type": "https://api.example.com/error/401/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "instance": "urn:uuid:02IiNr0G8viOVKjLCfR4NIEdgVrLpaxVcZ7BI",
  "detail": "Authorization for the request failed due to possible problems with the token (incorrect or expired), password (incorrect or changed), the user's unique identifier, or the user's status (e.g., missing, blocked, or deleted)."
}
```

#### Headers

`Access-Control-Allow-Headers`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin`, `Access-Control-Expose-Headers`, `Allow`, `Cache-Control`, `X-Powered-By`. Descriptions and example values are in the Response Header section below.

#### Schema

Same as `Problem` — see the Response Schema section below.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/401) · [HTTP.dev](https://http.dev/401)

### 404 · Not Found

Element does not exist, or the current user does not have permissions to access the element.

#### Body

```json
{
  "type": "https://api.example.com/error/404/not-found",
  "title": "Not found",
  "status": 404,
  "instance": "urn:uuid:02IiNr0G8viOVKjLCfR4NIEdgVrLpaxVcZ7BI",
  "detail": "Requested element was not found."
}
```

#### Headers

`Access-Control-Allow-Headers`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin`, `Access-Control-Expose-Headers`, `Allow`, `Cache-Control`, `X-Powered-By`. Descriptions and example values are in the Response Header section below.

#### Schema

Same as `Problem` — see the Response Schema section below.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404) · [HTTP.dev](https://http.dev/404)

### 412 · Precondition Failed

Precondition failed. `If-Match` or `If-None-Match` condition not met.

#### Body

```json
{
  "type": "https://api.example.com/error/412/precondition-failed",
  "title": "Precondition Failed",
  "status": 412,
  "instance": "urn:uuid:02IiNr0G8viOVKjLCfR4NIEdgVrLpaxVcZ7BI",
  "detail": "Precondition does not match."
}
```

#### Headers

`Access-Control-Allow-Headers`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin`, `Access-Control-Expose-Headers`, `Allow`, `Cache-Control`, `X-Powered-By`. Descriptions and example values are in the Response Header section below.

#### Schema

Same as `Problem` — see the Response Schema section below.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/412) · [HTTP.dev](https://http.dev/412)

### 416 · Range Not Satisfiable

The requested `Range` cannot be satisfied - its start is beyond the end of the file, the file is empty, or the range spans zero bytes.

#### Body

```json
{
  "type": "https://api.example.com/error/416/range-not-satisfiable",
  "title": "Range Not Satisfiable",
  "status": 416,
  "instance": "urn:uuid:02IiNr0G8viOVKjLCfR4NIEdgVrLpaxVcZ7BI",
  "detail": "Requested range start (999999999) is beyond the end of the resource (138937 bytes long).",
  "requestedStart": 999999999,
  "totalLength": 138937
}
```

#### Headers

`Access-Control-Allow-Headers`, `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin`, `Access-Control-Expose-Headers`, `Allow`, `Cache-Control`, `X-Powered-By`. Descriptions and example values are in the Response Header section below.

#### Schema

Same as `Problem` — see the Response Schema section below.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/416) · [HTTP.dev](https://http.dev/416)

## Request Parameters

### `uuid` (required)

`path · string · pattern ^(?:[0-9A-Za-z]{37}|[0-9A-Fa-f]{8}-[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}-[0-9A-Fa-f]{14})$`

Element id: a UUIDsv2a7 (draft-davis-uuidrev-uuid-long-00) of 27 bytes, 37 characters in base62sort; the same id in base16 with dashes (60 characters) is accepted as well.

## Request Header

### `Authorization` (optional)

Bearer token for user authentication. If omitted, the request is processed as an anonymous user; if provided, the associated user account is used.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization) · [HTTP.dev](https://http.dev/authorization) · [Authentication guide](/guide/authentication.md)

### `If-Match` (optional)

Used primarily for optimistic concurrency control — the request is only executed if the resource's `ETag` matches the provided value.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match) · [HTTP.dev](https://http.dev/if-match) · [Caching guide](/guide/caching-and-conditional-requests.md)

### `If-None-Match` (optional)

Used primarily for caching — skips re-downloading an unchanged resource by returning `304 Not Modified` if the resource's `ETag` matches the provided value.

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-None-Match) · [HTTP.dev](https://http.dev/if-none-match) · [Caching guide](/guide/caching-and-conditional-requests.md)

### `Range` (optional)

Requests a single byte range of the file instead of the full content: `bytes=[start]-[end]`, `bytes=[start]-` (open-ended) or `bytes=-[suffixLength]` (last N bytes) - e.g. `bytes=0-1048575` for the first megabyte. Multiple comma-separated ranges are not supported and fail with `400 Bad Request`.

## Response Schema

### `Problem`

Problem Details object, see RFC 9457.

```json
{
  "type": "object",
  "description": "Problem Details object, see RFC 9457.",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string",
      "format": "uri",
      "description": "URN uniquely identifying the request that produced this problem, as `urn:uuid:<uuid>`."
    }
  }
}
```

## Response Header

### `Content-Disposition` (always)

Provides the original filename, as well as additional file attributes. Non-ASCII filenames can be encoded using UTF-8, but require special escape sequences - see spec/docs for details.

Example: `attachment; filename=image.jpg`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) · [HTTP.dev](https://http.dev/content-disposition)

### `ETag` (always)

Entity tag used for caching and optimistic concurrency control.

Example: `"YgbFC4u5EgC"`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) · [HTTP.dev](https://http.dev/etag) · [Caching guide](/guide/caching-and-conditional-requests.md)

### `Repr-Digest` (optional)

Cryptographic digest of the file's full content, in RFC 9530 structured-field format. Only `sha-256` is supported: `sha-256=:[base64]:`, where the base64 payload is the raw 32-byte SHA-256 digest. Omitted if the element has no stored hash yet (e.g. records predating this feature).

Example: `sha-256=:X4a4pOezhox2tI5PXW8UAd7NAdOKPjE3wYlYs+eTt7Y=:`

[RFC 9530](https://datatracker.ietf.org/doc/html/rfc9530) · [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Repr-Digest)

### `Content-Range` (always)

Byte range actually returned, plus the total size of the file: `bytes [start]-[end]/[total]`, e.g. `bytes 0-99/138937`. Only present on a `206 Partial Content` response.

Example: `bytes 0-99/138937`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range) · [HTTP.dev](https://http.dev/content-range)

### Other Headers

#### `Access-Control-Allow-Headers` (always)

Lists the request headers which the endpoint reads and which browsers may send in cross-origin requests. Headers are listed explicitly, as the wildcard does not cover `Authorization`; resumable upload headers, for example, are only listed by upload endpoints.

Example: `Authorization, Content-Type, If-Match, If-None-Match`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Headers) · [HTTP.dev](https://http.dev/access-control-allow-headers)

#### `Access-Control-Allow-Methods` (always)

Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) · [HTTP.dev](https://http.dev/access-control-allow-methods)

#### `Access-Control-Allow-Origin` (always)

Specifies which origin may access the resource: the origin of the request (default), or `*` if `cors.allowedOrigins` is set to the wildcard. Not sent to origins which are not part of a configured list of `cors.allowedOrigins`.

Example: `*`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Origin) · [HTTP.dev](https://http.dev/access-control-allow-origin)

#### `Access-Control-Expose-Headers` (optional)

Lists the response headers which the endpoint can send and which browsers may access from JavaScript beyond the default restricted set. Only headers of the endpoint are listed; the header is omitted if the endpoint has none.

Example: `ETag`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Expose-Headers) · [HTTP.dev](https://http.dev/access-control-expose-headers)

#### `Accept-Ranges` (optional)

Always `bytes` - indicates that this endpoint honors the `Range` request header for partial downloads.

Example: `bytes`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Ranges) · [HTTP.dev](https://http.dev/accept-ranges)

#### `Allow` (always)

Lists the HTTP methods supported by the endpoint; returned alongside a `Method Not Allowed` response.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) · [HTTP.dev](https://http.dev/allow)

#### `Cache-Control` (always)

Directives controlling caching behavior for the response.

Example: `no-cache, private`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control) · [HTTP.dev](https://http.dev/cache-control)

#### `X-Powered-By` (always)

Identifies the underlying API implementation.

Example: `Ember Nexus API`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Powered-By) · [HTTP.dev](https://http.dev/x-powered-by)

#### `Access-Control-Allow-Methods` (always)

Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) · [HTTP.dev](https://http.dev/access-control-allow-methods)

#### `Allow` (always)

Lists the HTTP methods supported by the endpoint; returned alongside a `Method Not Allowed` response.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) · [HTTP.dev](https://http.dev/allow)

#### `Access-Control-Allow-Methods` (always)

Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) · [HTTP.dev](https://http.dev/access-control-allow-methods)

#### `Allow` (always)

Lists the HTTP methods supported by the endpoint; returned alongside a `Method Not Allowed` response.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) · [HTTP.dev](https://http.dev/allow)

#### `Access-Control-Allow-Methods` (always)

Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) · [HTTP.dev](https://http.dev/access-control-allow-methods)

#### `Allow` (always)

Lists the HTTP methods supported by the endpoint; returned alongside a `Method Not Allowed` response.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) · [HTTP.dev](https://http.dev/allow)

#### `Access-Control-Allow-Methods` (always)

Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) · [HTTP.dev](https://http.dev/access-control-allow-methods)

#### `Allow` (always)

Lists the HTTP methods supported by the endpoint; returned alongside a `Method Not Allowed` response.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) · [HTTP.dev](https://http.dev/allow)

#### `Access-Control-Allow-Methods` (always)

Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) · [HTTP.dev](https://http.dev/access-control-allow-methods)

#### `Allow` (always)

Lists the HTTP methods supported by the endpoint; returned alongside a `Method Not Allowed` response.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) · [HTTP.dev](https://http.dev/allow)

#### `Access-Control-Allow-Methods` (always)

Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods) · [HTTP.dev](https://http.dev/access-control-allow-methods)

#### `Allow` (always)

Lists the HTTP methods supported by the endpoint; returned alongside a `Method Not Allowed` response.

Example: `DELETE, GET, HEAD, OPTIONS, POST, PUT`

[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow) · [HTTP.dev](https://http.dev/allow)

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [Delete element](/api/delete-element.md)

Next: [Post element file](/api/post-element-file.md)
