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"
     }'
200 OK
This API endpoint creates a Datasource using the POST method.

Body

name
string
required
Provide a unique name for the Datasource.
description
string
Provide a description for the Datasource, which is used by the Mind to decide the relevant datasources for each question.
engine
array
required
Provide a datasource engine. See available engines here.
connection_data
array
required
Provide connection parameters for the selected engine. See available engines and connection parameters here.
tables
array
This is an optional parameter that lets you specify tables that can be accessed by the Mind.

Response

status
string
required
HTTP status code indicating success. 200 OK confirms the Datasource was created.

Authorization

A valid API key must be passed in the Authorization header:
Authorization: Bearer MINDS_API_KEY
Generate your API key here.

Path Parameters

None.
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"
     }'
200 OK