Create Datasource
This endpoint creates a Datasource.
Path parameters
None.
Authorization
- Name
MINDS_API_KEY
- Type
- string
- Required
- Description
Generate the Minds API key here and use it for authorization.
Request body
- Name
name
- Type
- string
- Required
- Description
Provide a unique name for the Datasource.
- Name
description
- Type
- string
- Required
- Description
Provide a description for the Datasource, which is used by the Mind to decide the relevant datasources for each question.
- Name
engine
- Type
- array
- Required
- Description
Provide a datasource engine. See available engines here.
- Name
connection_data
- Type
- array
- Required
- Description
Provide connection parameters for the selected engine. See available engines and connection parameters here.
- Name
tables
- Type
- array
- Description
This is an optional parameter that lets you specify tables that can be accessed by the Mind.
Request
curl --request POST \
--url 'https://mdb.ai/api/datasources' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer MINDS_API_KEY' \
--data '{
"name": "datasource_name",
"engine": "postgres",
"connection_data": {
"user": "demo_user",
"password": "demo_password",
"host": "samples.mindsdb.com",
"port": "5432",
"database": "demo",
"schema": "demo_data"
},
"tables": ["house_sales"],
"description": "House sales data"
}'
Response
200 OK
List Datasources
This endpoint lists all connected Datasources.
Path parameters
None.
Authorization
- Name
MINDS_API_KEY
- Type
- string
- Required
- Description
Generate the Minds API key here and use it for authorization.
Request body
None.
Request
curl --request GET \
--url 'https://mdb.ai/api/datasources' \
--header 'Authorization: Bearer MINDS_API_KEY'
Response
[
{
"connection_data": {
"database": "demo",
"host": "samples.mindsdb.com",
"password": "demo_password",
"port": "5432",
"schema": "demo_data",
"user": "demo_user"
},
"description": "House sales data",
"engine": "postgres",
"name": "my_datasource",
"tables": ["house_sales"],
},
...
]
Get Datasource
This endpoint lists details about a Datasource.
Path parameters
- Name
datasource_name
- Type
- string
- Required
- Description
Provide the name of the Datasource.
Authorization
- Name
MINDS_API_KEY
- Type
- string
- Required
- Description
Generate the Minds API key here and use it for authorization.
Request body
- Name
check_connection
- Type
- string
- Description
Set this value to
true
to check the connection to the data source.
Request
curl --request GET \
--url 'https://mdb.ai/api/datasources/datasource_name?check_connection=true' \
--header 'Authorization: Bearer MINDS_API_KEY'
Response
{
"connection_data": {
"database": "demo",
"host": "samples.mindsdb.com",
"password": "demo_password",
"port": "5432",
"schema": "demo_data",
"user": "demo_user"
},
"description": "House sales data",
"engine": "postgres",
"name": "my_datasource",
"tables": ["house_sales"],
}
Update Datasource
This endpoint updates the Datasource's description and/or connection parameters and/or list of tables.
Path parameters
- Name
datasource_name
- Type
- string
- Required
- Description
Provide the name of the Datasource.
Authorization
- Name
MINDS_API_KEY
- Type
- string
- Required
- Description
Generate the Minds API key here and use it for authorization.
Request body
- Name
description
- Type
- string
- Description
Provide a new description for the Datasource, which is used by the Mind to decide the relevant datasources for each question.
- Name
connection_data
- Type
- array
- Description
Provide the updated connection parameters for the selected engine. See available engines and connection parameters here.
- Name
tables
- Type
- array
- Description
This is an optional parameter that lets you specify tables that can be accessed by the Mind.
Request
curl --request PATCH \
--url 'https://mdb.ai/api/datasources/datasource_name' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer MINDS_API_KEY' \
--data '{
"connection_data": {
"user": "demo_user",
"password": "demo_password",
"host": "samples.mindsdb.com",
"port": "5432",
"database": "demo",
"schema": "demo_data"
},
"tables": ["sales_data"],
"description": "Sales data"
}'
Response
200 OK
Delete Datasource
This endpoint deletes a Datasource.
Path parameters
- Name
datasource_name
- Type
- string
- Required
- Description
Provide the name of the Datasource.
Authorization
- Name
MINDS_API_KEY
- Type
- string
- Required
- Description
Generate the Minds API key here and use it for authorization.
Request body
None.
Request
curl --request DELETE \
--url https://mdb.ai/api/datasources/datasource_name \
--header 'Authorization: Bearer MINDS_API_KEY'
Response
200 OK