docs/minds/rest_api/get_datasource.mdx
This API endpoint retrieves details about a specific Datasource using the GET method.
Set this value to true to check the connection to the data source.
Details for connecting to the data source including host, port, user, password, etc.
</ResponseField> <ResponseField name="connection_status" type="object">The status of the connection test, if check_connection=true. Includes success flag and error message if applicable.
Optional description of the datasource.
</ResponseField> <ResponseField name="engine" type="string" required>The engine type of the datasource (e.g., postgres).
</ResponseField> <ResponseField name="name" type="string" required>The unique name of the datasource.
</ResponseField> <ResponseField name="tables" type="array">List of tables that are accessible from this datasource.
</ResponseField>A valid API key must be passed in the Authorization header:
Authorization: Bearer MINDS_API_KEY
Generate your API key here.
The name of the Datasource you want to retrieve.
</ParamField> <RequestExample>curl --request GET \
--url 'https://mdb.ai/api/datasources/datasource_name?check_connection=true' \
--header 'Authorization: Bearer MINDS_API_KEY'
from minds.client import Client
client = Client("MINDS_API_KEY", "https://mdb.ai/")
datasource = client.datasources.get('datasource_name')
{
"connection_data": {
"database": "demo",
"host": "samples.mindsdb.com",
"password": "demo_password",
"port": "5432",
"schema": "demo_data",
"user": "demo_user"
},
"connection_status": {
"error_message": null,
"success": true
},
"description": "House sales data",
"engine": "postgres",
"name": "my_datasource",
"tables": ["house_sales"]
}