---
title: "Stream a GCS file as a binary CSV attachment"
method: GET
path: "/file/download"
tags: ["File Storage Resource"]
---

# Stream a GCS file as a binary CSV attachment

`GET /file/download`

Retrieves a file from the configured Google Cloud Storage bucket by its object path and streams it back to the caller as a binary attachment. The response carries a Content-Disposition: attachment; filename="data.csv" header, which triggers a browser download using the static filename data.csv regardless of the original object name. Use this endpoint when you need the raw file bytes, such as offering the original CSV for download; use GET /file/read instead when you need the file parsed into structured JSON. Supply the path query parameter with the GCS object name (for example, imports/my-file.csv) and a valid JWT. On success returns HTTP 200 with the file content as text/csv.

## Query parameters

- `path` string

## Headers

- `tenant-id` string, required

## Response `200`

The requested file streamed as text/csv, with a Content-Disposition attachment header using the static filename data.csv.

## Other responses

- `401` — Authentication failed. Supply a valid JWT bearer token.
- `404` — The file could not be retrieved from GCS. There is no path validation on this endpoint; the server currently maps any retrieval failure — including an invalid or non-existent path — to this status, so a 404 does not necessarily mean the object is absent.
- `500` — An unexpected server error occurred while streaming the file. The exact response body is not guaranteed by the endpoint's own error handling; it may be produced by the underlying framework's default error handler. Retry; if the problem persists, contact support.

---

[API](https://skmtc.net/certifyos/apis/certify-api-layer.md) · [All operations](https://skmtc.net/certifyos/apis/certify-api-layer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/certifyos/certify-api-layer/revisions/563848e0ecc0/schema)
