Download the binary content of a file using a signed URL token.
Serves the raw file content with the correct Content-Type header. Authentication is handled via a signed token in the query parameters rather than an Authorization header, making this endpoint compatible with browser-native resource loading (e.g., <img src="...">, <a href="...">).
Important: Do not call this endpoint directly. Instead, use the Get file content URL endpoint to obtain a signed download URL, then use that URL to fetch the file.
organization_id string required
The unique identifier of the organization.
file_id string required
The unique identifier of the file (format: file_*).
token string required
The HMAC-signed download token. Obtained from the Get file content URL endpoint.
expires integer required
Unix timestamp when the token expires. Tokens are valid for 1 hour from creation.
The raw file bytes with the appropriate Content-Type header (e.g., image/png, application/pdf). The response includes a Cache-Control: private, max-age=3600 header.
| Status | Code | Description |
|---|---|---|
| 401 | TOKEN_INVALID | The token is invalid, expired, or was signed for a different file |
| 404 | FILE_NOT_FOUND | The file does not exist or has been deleted |
- Bash
- Python
- Python
- HTML
# Step 1: Get the signed download URL (authenticated)
CONTENT=$(curl -s https://api.aitronos.com/v1/organizations/org_123/files/file_abc123/download \
-H "X-API-Key: $FREDDY_API_KEY")
DOWNLOAD_URL=$(echo $CONTENT | jq -r '.download_url')
# Step 2: Download the file (no auth header needed)
curl -o downloaded_file.png "$DOWNLOAD_URL"