Skip to main content

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

HeaderRequiredDescription
AuthorizationYesBearer <access_token>

Path Parameters

ParameterTypeRequiredDescription
data_source_idintegerYesData source ID

Query Parameters

ParameterTypeRequiredDescription
expires_secondsintegerNoURL 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

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser is not a member of any organization
404NOT_FOUNDData source not found or no file path associated
500INTERNAL_SERVER_ERRORFailed 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>"