Skip to main content
get/files/{file_id}/preview
Request example
Response
get/files/{file_id}/preview

Authorization

Authorizationstringheaderrequired#

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_idstringrequired#
ID of the file to download, from the Upload File response.

Query parameters

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

Default: false

userstring#
End-user identifier, defined by your app and unique within it. It has no effect on file access here, which is scoped by app and message rather than by user. See End User Identity.

Responses

application/octet-stream
Returns the raw file content. The Content-Type header is set to the file's MIME type. If as_attachment is true, the file is returned as a download with Content-Disposition: attachment.