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, from the Upload File response.

Query Parameters

as_attachment
boolean
default:false

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

user
string

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.

Response

Returns the raw file content, displayed inline with Content-Type set to the file's MIME type. If as_attachment is true, the file downloads instead, as application/octet-stream with Content-Disposition: attachment.

These files download that way even when as_attachment is false:

  • HTML, XHTML, XML, and XSL files, recognized by MIME type (text/html, application/xml, text/xml, text/xsl, or any type ending in +xml other than SVG) or by extension (.html, .htm, .xhtml, .xht, .xml, .xsl, .xslt)
  • Compressed SVG files (.svgz)
  • Files with no MIME type

SVG files are the exception: a file with the image/svg+xml MIME type or the .svg extension still displays inline as image/svg+xml when as_attachment is false, even if it also matches the list above. It's served in a sandbox that blocks scripts.

The response is of type file.