Get Data Source File URL
Sprint 3
Get a presigned URL for accessing a file-based data source's file in storage.
Endpoint
GET /api/v1/data-sources/{data_source_id}/file-url
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data_source_id | integer | Yes | Data source ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
expires_seconds | integer | No | URL expiration time in seconds (default: 3600, min: 1, max: 604800) |
Response
Success (200)
{
"success": true,
"data": {
"url": "https://storage.example.com/bucket/organizations/1/files/1/file.csv?X-Amz-Algorithm=...",
"expires_in_seconds": 3600
},
"message": "Presigned URL generated successfully"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing authentication token |
| 403 | FORBIDDEN | User is not a member of any organization |
| 404 | NOT_FOUND | Data source not found or no file path associated |
| 500 | INTERNAL_SERVER_ERROR | Failed to generate presigned URL |
Features
- Generates presigned URL for file access
- Configurable expiration time (1-604800 seconds, default: 3600)
- Only works for file-based data sources
- Organization-scoped access control
Example
curl -X GET "https://api.rivergen.com/api/v1/data-sources/1/file-url?expires_seconds=7200" \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- Get Data Source - Get data source details including file_path
- Storage API - Storage management endpoints