Skip to main content
GET
Download File

Authorizations

Authorization
string
header
required

Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).

Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).

Path Parameters

file_id
string<uuid>
required

ID of the file to download. Two sources: the id returned by Upload File, and the upload_file_id of an entry in a message's message_files from List Conversation Messages. Tool-produced files need kind=tool.

Query Parameters

user
string
required

End-user identifier, defined by your app and unique within it. Must match the user that owns the file. See End User Identity.

Required string length: 1 - 255
as_attachment
boolean
default:false

When true, the file downloads as an attachment instead of rendering inline in the browser.

kind
enum<string>
default:upload

File source. URLs returned in message payloads already carry the right value; set it manually only when constructing URLs yourself.

Available options:
upload,
tool

Response

The raw file content. Content-Type is the file's own MIME type. When as_attachment is true, the response is sent as application/octet-stream with Content-Disposition: attachment. HTML files always download, whatever as_attachment says.

The response is of type file.