Download Statement File

GET /api/v1/statements/:id/download

Streams the original uploaded file bytes (PDF, CSV, Excel, etc.) for the given statement. The response uses Content-Disposition: attachment so HTTP clients will save the file with the original filename.

The bytes are fetched from object storage by the API server and proxied to the client — no signed URL is exposed.

Authentication

Requires statements:read permission.

Path Parameters

ParameterTypeDescription
idstringStatement ID

Response

200 OK — the response body is the raw file bytes.

HeaderValue
Content-TypeThe statement's stored mime_type (e.g. application/pdf, text/csv). Falls back to application/octet-stream.
Content-Dispositionattachment; filename="<original_file_name>"
Content-LengthByte size (from the statement's file_size, or S3's reported length).

Example Request

curl -X GET "https://statements.finopsbricks.com/api/v1/statements/abc123/download" \
  -H "api-key: fob_stm_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx" \
  -O -J

The -O -J flags tell curl to honor the server's Content-Disposition filename. Without -J, curl writes to a file named download.

Errors

CodeDescription
401Invalid or missing API credentials
403API key lacks statements:read permission
404Statement not found (NOT_FOUND) or statement has no associated file (FILE_NOT_AVAILABLE — e.g. created without an upload)
502Object storage error fetching the file (STORAGE_ERROR)