Get Data Source
Sprint 3
Get detailed information about a specific data source by ID.
Endpoint
GET /api/v1/data-sources/{data_source_id}
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data_source_id | integer | Yes | Data source ID |
Response
Success (200)
{
"success": true,
"data": {
"id": 1,
"organization_id": 1,
"workspace_id": 1,
"name": "Production PostgreSQL",
"type": "postgresql",
"description": "Main production database",
"host": "db.example.com",
"port": 5432,
"database_name": "production",
"schema_name": "public",
"connection_string": null,
"file_path": null,
"use_ssh_tunnel": false,
"ssh_host": null,
"ssh_port": null,
"ssh_username": null,
"ssh_key_id": null,
"ssh_local_port": null,
"connection_pool_size": 5,
"connection_timeout": 30,
"query_timeout": 300,
"max_retries": 3,
"status": "active",
"last_tested_at": "2024-12-01T10:00:00Z",
"last_successful_connection_at": "2024-12-01T10:00:00Z",
"last_failed_connection_at": null,
"failure_count": 0,
"failure_reason": null,
"schema_discovered_at": "2024-12-01T09:00:00Z",
"schema_auto_refresh": true,
"schema_refresh_interval": 3600,
"metadata": {},
"tags": ["production", "database"],
"created_by_user_id": 1,
"created_at": "2024-12-01T08:00:00Z",
"updated_at": "2024-12-01T10:00:00Z",
"updated_by_user_id": 1
},
"message": "Data source retrieved 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 |
Features
- Returns complete data source configuration
- Includes connection status and health information
- Shows schema discovery status
- Organization-scoped access control
Example
curl -X GET "https://api.rivergen.com/api/v1/data-sources/1" \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- List Data Sources - List all data sources
- Update Data Source - Update data source configuration