Back to Mindsdb

Add Data to Mind

docs/minds/rest_api/add_data_to_mind.mdx

26.1.01.5 KB
Original Source

This API endpoint adds a data source to a specific Mind using the POST method.

Body

<ParamField body='name' type='string' required>

The name of the data source to be added to the Mind. Use this endpoint to create data sources.

</ParamField> <ParamField body='check_connection' type='string'>

Set this value to true to check the connection to the data source.

</ParamField>

Response

<ResponseField name="success" type="boolean" required>

Indicates whether the data source was successfully added to the Mind.

</ResponseField>

Authorization

A valid API key must be passed in the Authorization header:

Authorization: Bearer MINDS_API_KEY

Generate your API key here.

Path Parameters

<ParamField body='mind_name' type='string' required>

The name of the Mind to which the data source will be added.

</ParamField> <RequestExample>
shell
curl --request POST \
     --url 'https://mdb.ai/api/projects/mindsdb/minds/mind_name_new/datasources' \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer MINDS_API_KEY' \
     --data '{
         "name": "datasource_name",
         "check_connection": true
     }'
python
from minds.client import Client

client = Client("MINDS_API_KEY", "https://mdb.ai/")

mind.add_datasource(postgres_config)
</RequestExample> <ResponseExample>
json
{
  "success": true
}
</ResponseExample>