---
title: "Create a new datasource"
method: POST
path: "/api/2.0/datasources"
---

# Create a new datasource

`POST /api/2.0/datasources`

## Request

- Base URL: `https://app.agenticbi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.agenticbi.com/api/2.0/datasources`
- Auth: HTTP bearer

## Request body

- union
  - MongoDBDatasource: MongoDB Datasource information
    - `name` string, required: Datasource name
    - `datasource` string, required: Datasource type. Possible values: bigquery, cloud9charts, cloudant, couchbase, datastax, elasticsearch, ga, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, salesforce, redshift, restapi, snowflake, spark, sqlserver, teradata
    - `privateConnector` string: ID of private connector
    - `proxy` boolean: Enable proxy server usage
    - `proxyAddress` string: Proxy server address
    - `dbProperties` string: (datastax, elasticsearch, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver) Database specific properties in datasource specific format such as headers, query string, etc
    - `userId` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User ID
    - `password` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User password
    - `host` string: (couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database host(s)
    - `dbName` string: (cloudant, couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database, Bucket, or Keyspace name
    - `port` integer: (datastax, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database port
    - `legacyVersionSupport` boolean
    - `legacyMode` boolean
    - `dsDisplayName` string: Datasource full name to display
  - MySQLDBDatasource: MySQL Datasource information
    - `name` string, required: Datasource name
    - `datasource` string, required: Datasource type. Possible values: bigquery, cloud9charts, cloudant, couchbase, datastax, elasticsearch, ga, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, salesforce, redshift, restapi, snowflake, spark, sqlserver, teradata
    - `privateConnector` string: ID of private connector
    - `proxy` boolean: Enable proxy server usage
    - `proxyAddress` string: Proxy server address
    - `dbProperties` string: (datastax, elasticsearch, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver) Database specific properties in datasource specific format such as headers, query string, etc
    - `userId` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User ID
    - `password` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User password
    - `host` string: (couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database host(s)
    - `dbName` string: (cloudant, couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database, Bucket, or Keyspace name
    - `port` integer: (datastax, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database port
    - `schema` string: (hana, hive, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Schema name
    - `dsDisplayName` string: Datasource full name to display

## Response `200`

Success

- ConnectorDatasource: Datasource information
  - `createdDate` integer: Created date in milliseconds
  - `lastModDate` integer: Last modified date
  - `jsonConfig` union: Datasource type specific information
    - object: MongoDB Datasource information
      - `name` string, required: Datasource name
      - `datasource` string, required: Datasource type. Possible values: bigquery, cloud9charts, cloudant, couchbase, datastax, elasticsearch, ga, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, salesforce, redshift, restapi, snowflake, spark, sqlserver, teradata
      - `privateConnector` string: ID of private connector
      - `proxy` boolean: Enable proxy server usage
      - `proxyAddress` string: Proxy server address
      - `dbProperties` string: (datastax, elasticsearch, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver) Database specific properties in datasource specific format such as headers, query string, etc
      - `userId` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User ID
      - `password` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User password
      - `host` string: (couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database host(s)
      - `dbName` string: (cloudant, couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database, Bucket, or Keyspace name
      - `port` integer: (datastax, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database port
      - `legacyVersionSupport` boolean
      - `legacyMode` boolean
      - `dsDisplayName` string: Datasource full name to display
    - object: MySQL Datasource information
      - `name` string, required: Datasource name
      - `datasource` string, required: Datasource type. Possible values: bigquery, cloud9charts, cloudant, couchbase, datastax, elasticsearch, ga, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, salesforce, redshift, restapi, snowflake, spark, sqlserver, teradata
      - `privateConnector` string: ID of private connector
      - `proxy` boolean: Enable proxy server usage
      - `proxyAddress` string: Proxy server address
      - `dbProperties` string: (datastax, elasticsearch, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver) Database specific properties in datasource specific format such as headers, query string, etc
      - `userId` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User ID
      - `password` string: (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User password
      - `host` string: (couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database host(s)
      - `dbName` string: (cloudant, couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database, Bucket, or Keyspace name
      - `port` integer: (datastax, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database port
      - `schema` string: (hana, hive, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Schema name
      - `dsDisplayName` string: Datasource full name to display
  - `id` integer: Datasource ID
  - `name` string, required: Datasource name
  - `datasource` string: Datasource type
  - `userId` integer: User ID of Datasource owner
  - `connectorId` integer: Connector ID of the connector that the datasource is assigned to
  - `accessLevel` integer: Access level of the datasource for current user
  - `acl` Rule[]
    - `type` integer: Type
    - `regex` boolean: Whether or not the value is a regular expression or just plain text
    - `value` string: Rule match value
  - `username` string: Datasource owner's username
  - `proxy` boolean: Whether or not direct query can be allowed on a private agent for this datasource. Note that the private agent needs to have proxy enabled as well.
  - `connectSchema` boolean: Whether or not this has schema detection enabled
  - `directQueryOnly` boolean: Whether or not this datasource is only allow direct query
  - `timeZone` string: Timezone
  - `userEmail` string

## Other responses

- `400`: Bad request
- `401`: User is not authenticated
- `403`: User is not allowed to access this resource
- `500`: Error during processing

---

[API](https://skmtc.dev/agenticbi/apis/user-management-api.md) · [All operations](https://skmtc.dev/agenticbi/apis/user-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agenticbi/apis/user-management-api/revisions/62c42a99830e?raw)
