docs/minds/rest_api/update_datasource.mdx
This API endpoint updates the Datasource's description and/or connection parameters and/or list of tables using the PATCH method.
Provide a new description for the Datasource, which is used by the Mind to decide the relevant datasources for each question.
</ParamField> <ParamField body='connection_data' type='array'>Provide the updated connection parameters for the selected engine. See available engines and connection parameters here.
</ParamField> <ParamField body='tables' type='array'>This is an optional parameter that lets you specify tables that can be accessed by the Mind.
</ParamField>HTTP status code indicating success. 200 OK confirms the Datasource was updated.
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 update.
</ParamField> <RequestExample>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"
}'
from minds.client import Client
client = Client("MINDS_API_KEY", "https://mdb.ai/")
# the create function updates the datasource
# provided that postgres_config's name is one of the existing datasources
datasource = client.datasources.create(postgres_config)
200 OK