list-data-sources
List Data Sources
Sprint 3
Platform
List all data sources for the current organization with pagination, filtering, and sorting.
Account Type & Use Case
Platform Account
Platform APIs enable data engineers and analysts to discover and manage all connected data sources within their organization, providing visibility into available data assets and their health status. This endpoint is used to browse, filter, and search data sources, enabling quick discovery of relevant data for analysis and querying.
Endpoint
GET /api/v1/data-sources
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_id | integer | No | Filter by workspace ID |
type | string | No | Filter by data source type (e.g., "postgresql", "mysql", "csv") |
status_filter | string | No | Filter by status (active, inactive, testing, failed, maintenance) |
page | integer | No | Page number (default: 1) |
page_size | integer | No | Items per page (default: 20) |
search | string | No | Search by name or description |
sort_by | string | No | Sort field (default: "created_at") |
sort_order | string | No | Sort order: "asc" or "desc" (default: "desc") |
Response
Success (200)
{
"success": true,
"data": {
"items": [
{
"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",
"file_path": null,
"use_ssh_tunnel": false,
"ssh_host": null,
"ssh_port": null,
"status": "active",
"last_tested_at": "2024-12-01T10:00:00Z",
"last_successful_connection_at": "2024-12-01T10:00:00Z",
"schema_discovered_at": "2024-12-01T09:00:00Z",
"schema_auto_refresh": true,
"tags": ["production", "database"],
"created_at": "2024-12-01T08:00:00Z",
"updated_at": "2024-12-01T10:00:00Z"
}
],
"pagination": {
"page": 1,
"page_size": 20,
"total_items": 15,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
},
"message": "Data sources retrieved successfully"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing authentication token |
| 403 | FORBIDDEN | User is not a member of any organization |
Features
- Pagination support
- Filtering by workspace, type, and status
- Search by name or description
- Sorting by any field
- Organization-scoped (only shows data sources in user's organization)
Example
curl -X GET "https://api.rivergen.com/api/v1/data-sources?page=1&page_size=20&type=postgresql&status_filter=active" \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- Get Data Source - Get single data source details
- Create Data Source - Create new data source