Skip to content

Serve a stored file

GET
/files/{key}
Code sample: Shell / cURL
curl --request GET \
--url https://example.com/api/v1/files/example \
--header 'Authorization: Bearer <token>'

Source files (HTML, HTM, SVG, JS, MJS and TS) stream with attachment disposition, application/octet-stream and X-Content-Type-Options: nosniff; S3 source downloads support single Range requests. Other files return local bytes or a 302 redirect to a presigned S3 URL. Requires authentication only. A workspace- or user-namespaced key is authorized against the workspace or user it names. Every authorization path requires an active, non-suspended workspace membership. Legacy keys without a namespace are rejected. A client member reads only what its portal shows them: a message attachment or an editor image held by content within their reach, or an editor image they uploaded. Any other workspace file answers 404 to a client.

key
required

File key/path, URL-encoded. May contain slashes (e.g. editor-images/abc.png).

string
>= 1 characters

File key/path, URL-encoded. May contain slashes (e.g. editor-images/abc.png).

File bytes (source files force download).

Partial source file bytes from S3 (Content-Range).

Media typeapplication/octet-stream

Redirect to a presigned S3 URL (Location header).

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

File not found. Note: this body has no status field, unlike the standard error envelope.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed value: NOT_FOUND
message
required
string

Example

{
"error": {
"code": "NOT_FOUND"
}
}

Invalid or unsatisfiable source file range.