Super.ai files API
File download operations for retrieving files from gs:// storage URIs. When Super.AI Flows processes documents, task outputs often include file references as `gs://` URIs pointing to Google Cloud Storage. These endpoints let you download those files without needing to understand GCS internals or parse storage URLs. **The problem these endpoints solve:** Previously, downloading a file required: 1. Recognizing the URL as a GCS reference 2. Parsing out the file key from the URI 3. Calling a separate endpoint to get a signed URL 4. Downloading using that signed URL **Now it's simple:** Pass the `gs://` URI exactly as received and get your file. **Two ways to download:** 1. **Direct download** (`GET /files/download`): Returns a redirect to the file. Perfect for curl with `-L` flag. ``` curl -L -H "X-API-Key: saf_xxx" "https://flows.super.ai/api/files/download?uri=gs://..." -o file.pdf ``` 2. **Resolve first** (`POST /files/resolve`): Returns a JSON response with the download URL. Better for programmatic use and sensitive files (keeps URI out of logs). ``` curl -X POST "https://flows.super.ai/api/files/resolve" \ -H "X-API-Key: saf_xxx" \ -H "Content-Type: application/json" \ -d '{"uri": "gs://..."}' ``` **Security:** - Files are organization-scoped: you can only download files from flows your organization owns - URIs are validated to prevent path traversal attacks - Download URLs expire after 1 hour **Common use cases:** - Download processed documents from completed flow executions - Retrieve extracted data files from task outputs - Integrate file downloads into automated pipelines