GET /api/download
Generates a 1-hour signed URL for the standardized Output File and returns a human-readable filename suitable for the browser’s download dialog.
Request
Method: GET
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id | string | Yes | UUID of a completed job |
Headers: Authorization: Bearer <token>
GET /api/download?job_id=abc-123-def
Authorization: Bearer <token>Processing Steps
- Authenticate via
checkAuth() - Validate query parameter and fetch the full job row
- Check status — job must be
completeand have anoutput_storage_path - Generate signed URL — create a Supabase Storage signed URL for the Output File with a 3600-second (1-hour) expiry
- Build filename — assemble a clean, human-readable filename from job metadata
Filename Format
The filename is built from the job’s property_name and report_date:
[Property Name] - Standardized - [Month Year].xlsxExamples:
| property_name | report_date | Generated Filename |
|---|---|---|
| Montrose at Vintage Park | 2025-02-10 | Montrose at Vintage Park - Standardized - February 2025.xlsx |
| The Heights on Main | 2027-01-15 | The Heights on Main - Standardized - January 2027.xlsx |
| (empty) | 2025-06-01 | Rent Roll - Standardized - June 2025.xlsx |
| Oak Creek Apartments | (null) | Oak Creek Apartments - Standardized.xlsx |
Special characters in the property name are stripped (only alphanumeric characters and spaces are kept). If the property name is empty, "Rent Roll" is used as a fallback. If the report date is null or unparseable, the date segment is omitted.
Response
Success (200):
{
"url": "https://xyz.supabase.co/storage/v1/object/sign/etl-files/outputs/.../output.xlsx?token=...",
"filename": "Montrose at Vintage Park - Standardized - February 2025.xlsx",
"unit_count": 312
}| Field | Type | Description |
|---|---|---|
url | string | Signed URL valid for 1 hour |
filename | string | Suggested download filename |
unit_count | number | Total extracted Units (convenience field from the job row) |
Validation Errors
| Check | Status | Message |
|---|---|---|
Missing job_id | 400 | Missing job_id |
| Job not found | 500 | Job not found |
| Job not complete | 400 | Job not complete. Status: [status] |
| No Output File | 404 | No output file found |
| Bad/missing token | 401 | Unauthorized |
Error (400):
{
"error": "Job not complete. Status: extracting"
}Error (404):
{
"error": "No output file found"
}Usage Notes
- The signed URL expires after 1 hour. If the user needs to download the Output File again after expiry, call this endpoint again to generate a fresh URL.
- The
filenamefield is a suggestion for the client. When triggering a browser download, set theContent-Dispositionheader or use thedownloadattribute on an anchor tag:
<a href={url} download={filename}>Download</a>- The
unit_countfield is included as a convenience so the download UI can display how many Units are in the Output File without making a separate API call.
Last updated on