Skip to main content

Core CRUD

Basic datasource creation, retrieval, update, and deletion operations.

GET /api/datasources

List all datasources.

Query Parameters:

ParameterTypeDefaultDescription
qstring-Search query
typestring-Filter by driver type
sortstring-Sort field
limitinteger30Results per page
startinteger0Pagination offset

Response:

The response is a paginated HAL collection. Datasource items are returned under _embedded["inf:datasource"].

{
"_links": {
"self": { "href": "/api/datasources{?sort,limit,start,q,type}", "templated": true }
},
"_embedded": {
"inf:datasource": [
{
"_links": {
"self": { "href": "/api/datasources/a1b2c3d4-..." }
},
"id": "a1b2c3d4-...",
"name": "Production MySQL",
"type": "mysql",
"host": "db.example.com",
"port": 3306,
"database": "production",
"username": "app_user",
"ownerId": "data-team",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-02-08T14:30:00.000Z"
}
]
},
"start": 0,
"count": 1,
"total": 5
}

POST /api/datasources

Create a new datasource.

Permissions: datasources:create

Request Body:

{
"name": "Production MySQL",
"type": "mysql",
"host": "db.example.com",
"port": 3306,
"database": "production",
"username": "app_user",
"password": "secretPassword",
"options": {
"connectionLimit": 10
},
"ssl": {
"rejectUnauthorized": true
}
}

Required Fields:

FieldTypeDescription
namestringDatasource name
typestringDriver type
hoststringServer hostname
databasestringDatabase name

Optional Fields:

FieldTypeDefaultDescription
portintegerDriver defaultConnection port
usernamestring-Auth username
passwordstring-Auth password
optionsobject{}Driver-specific options
sslobject-SSL configuration

Response:

201 Created with datasource object and Location header.


GET /api/datasources/{id}

Get a specific datasource.

Response:

{
"id": "mysql-prod",
"name": "Production MySQL",
"type": "mysql",
"host": "db.example.com",
"port": 3306,
"database": "production",
"username": "app_user",
"options": {},
"ssl": {},
"ownerId": "team:data",
"createdAt": "2024-01-15T10:00:00Z",
"_links": {
"self": { "href": "/api/datasources/mysql-prod" },
"inf:test": { "href": "/api/datasources/mysql-prod/_test" },
"inf:mappings": { "href": "/api/datasources/mysql-prod/mappings" },
"inf:features": { "href": "/api/datasources/mysql-prod/features" }
}
}

Note: Password fields are never returned in responses.


PUT /api/datasources/{id}

Update a datasource.

Permissions: datasource:write

Request Body:

{
"name": "Updated MySQL Production",
"port": 3307,
"options": {
"connectionLimit": 20
}
}

Response:

Returns updated datasource object.


DELETE /api/datasources/{id}

Delete a datasource.

Permissions: datasource:write

Response:

204 No Content on success.

Warning:

Deleting a datasource may affect datasets and reports that depend on it.