Skip to main content

Connection Testing

Test datasource connectivity and validate configuration.

POST /api/datasources/{id}/_test

Test a datasource connection.

Permissions: datasource:test

Path Parameters:

ParameterTypeDescription
idstringDatasource ID

Response:

{
"success": true,
"message": "Connection successful",
"latency": 45,
"serverVersion": "8.0.32-MySQL",
"database": "production"
}

Error Response:

{
"success": false,
"error": "Connection refused",
"message": "Unable to connect to database server at db.example.com:3306"
}

Status Codes:

  • 200 OK - Connection test completed (check success field)
  • 400 Bad Request - Invalid datasource configuration
  • 403 Forbidden - Missing permission

Use Case:

Verify datasource is accessible before creating datasets or running queries.


POST /api/datasources/_test-config

Test a datasource configuration without saving.

Permissions: datasources:create

Request Body:

{
"type": "mysql",
"host": "db.example.com",
"port": 3306,
"database": "production",
"username": "app_user",
"password": "secretPassword",
"options": {},
"ssl": {}
}

Response:

Same structure as POST /_test endpoint.

Use Case:

Validate connection settings during datasource creation wizard before saving.