Skip to content

Download File

GET/web/v1/files/query/{fileBizId}/downloadJWT + Turnstile

Downloads a file directly as a streamed binary response. The response includes appropriate Content-Disposition, Content-Type, and Content-Length headers.

Authentication

Auth Chain: WEB Chain — requires Authorization: Bearer <jwt> and Turnstile token. These headers are injected by the system (frontend does nothing): X-PORTAL-ACCESS-CODE (Nginx), X-Request-Id (Gateway)

Request Parameters

NameTypeRequiredInDescription
fileBizIdstringYespathFile business ID

Success Response

The response is a binary file stream with the following headers:

HeaderExample Value
Content-Dispositionattachment; filename="invoice.pdf"
Content-Typeapplication/pdf
Content-Length102400

Error Responses

Unauthorized401
{
  "success": false,
  "code": "4010",
  "message": "Invalid or expired token"
}
Not Found404
{
  "success": false,
  "code": "4040",
  "message": "File not found"
}

Notes

  • The response body is a raw binary stream, not a JSON envelope.
  • For large files, consider using Get Download URL instead to offload the download to object storage directly.
  • The original filename is preserved in the Content-Disposition header.

Internal Documentation