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 ), or bin if none could be determined.
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 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 for the exact supported syntax and error cases, or the managing big files 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.
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
curl \ -H 'Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc' \ https://api.example.com/02IiNr0GOoKiPMM1keIQn6X4HCRG6E9xAcDJ9/fileimport requests
url = "https://api.example.com/02IiNr0GOoKiPMM1keIQn6X4HCRG6E9xAcDJ9/file"
headers = {"Authorization": "Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.example.com/02IiNr0GOoKiPMM1keIQn6X4HCRG6E9xAcDJ9/file';const options = { method: 'GET', headers: {Authorization: 'Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.example.com/02IiNr0GOoKiPMM1keIQn6X4HCRG6E9xAcDJ9/file', [ 'headers' => [ 'Authorization' => 'Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc', ],]);
echo $response->getBody();Response
200 · OK
File found and returned as a stream. No Range header was sent, so the complete file is returned.
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.
304 · Not Modified
Not modified. Returned when If-None-Match header matches current ETag.
400 · Bad Request
The Range header could not be parsed, or requests more than one range.
404 · Not Found
Element does not exist, or the current user does not have permissions to access the element.
412 · Precondition Failed
Precondition failed. If-Match or If-None-Match condition not met.
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.
binary response / raw file
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAccept-Ranges: bytesAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateContent-Disposition: attachment; filename=image.jpgETag: "YgbFC4u5EgC"Repr-Digest: sha-256=:X4a4pOezhox2tI5PXW8UAd7NAdOKPjE3wYlYs+eTt7Y=:X-Powered-By: Ember Nexus API{ "type": "string", "format": "binary"}binary response / raw file
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAccept-Ranges: bytesAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateContent-Disposition: attachment; filename=image.jpgContent-Range: bytes 0-99/138937ETag: "YgbFC4u5EgC"Repr-Digest: sha-256=:X4a4pOezhox2tI5PXW8UAd7NAdOKPjE3wYlYs+eTt7Y=:X-Powered-By: Ember Nexus API{ "type": "string", "format": "binary"}response has no body
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateETag: "YgbFC4u5EgC"X-Powered-By: Ember Nexus APIno schema available
{ "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."}Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateX-Powered-By: Ember Nexus API{ "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>`." } }}{ "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)."}Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateX-Powered-By: Ember Nexus API{ "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>`." } }}{ "type": "https://api.example.com/error/404/not-found", "title": "Not found", "status": 404, "instance": "urn:uuid:02IiNr0G8viOVKjLCfR4NIEdgVrLpaxVcZ7BI", "detail": "Requested element was not found."}Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateX-Powered-By: Ember Nexus API{ "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>`." } }}{ "type": "https://api.example.com/error/412/precondition-failed", "title": "Precondition Failed", "status": 412, "instance": "urn:uuid:02IiNr0G8viOVKjLCfR4NIEdgVrLpaxVcZ7BI", "detail": "Precondition does not match."}Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateX-Powered-By: Ember Nexus API{ "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>`." } }}{ "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}Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-None-MatchAccess-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETagAllow: DELETE, GET, HEAD, OPTIONS, POST, PUTCache-Control: no-cache, privateX-Powered-By: Ember Nexus API{ "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>`." } }}Request Parameters
uuid
required
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.
If-Match
optional
Used primarily for optimistic concurrency control — the request is only executed if the resource's ETag matches the provided value.
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.
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 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.
ETag
always
Entity tag used for caching and optimistic concurrency control.
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).
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.
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.
Access-Control-Allow-Methods
always
Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.
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.
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.
Accept-Ranges
optional
Always bytes - indicates that this endpoint honors the Range request header for partial downloads.
Allow
always
Lists the HTTP methods supported by the endpoint; returned alongside a Method Not Allowed response.
Cache-Control
always
Directives controlling caching behavior for the response.
Access-Control-Allow-Methods
always
Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.
Allow
always
Lists the HTTP methods supported by the endpoint; returned alongside a Method Not Allowed response.
Access-Control-Allow-Methods
always
Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.
Allow
always
Lists the HTTP methods supported by the endpoint; returned alongside a Method Not Allowed response.
Access-Control-Allow-Methods
always
Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.
Allow
always
Lists the HTTP methods supported by the endpoint; returned alongside a Method Not Allowed response.
Access-Control-Allow-Methods
always
Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.
Allow
always
Lists the HTTP methods supported by the endpoint; returned alongside a Method Not Allowed response.
Access-Control-Allow-Methods
always
Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.
Allow
always
Lists the HTTP methods supported by the endpoint; returned alongside a Method Not Allowed response.
Access-Control-Allow-Methods
always
Indicates which HTTP methods are permitted for cross-origin requests, typically returned in preflight responses.
Allow
always
Lists the HTTP methods supported by the endpoint; returned alongside a Method Not Allowed response.