Skip to main content
POST
/
organizations
/
{organizationName}
/
projects
/
{projectName}
/
connections
Create database connection
curl --request POST \
  --url https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/projects/{projectName}/connections \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "resource": "<string>",
  "name": "<string>",
  "type": "postgres",
  "attributes": {
    "dialectName": "<string>",
    "isPool": true,
    "canPersist": true,
    "canStream": true
  },
  "postgresConnection": {
    "host": "<string>",
    "port": 123,
    "databaseName": "<string>",
    "userName": "<string>",
    "password": "<string>",
    "connectionString": "<string>"
  },
  "bigqueryConnection": {
    "defaultProjectId": "<string>",
    "billingProjectId": "<string>",
    "location": "<string>",
    "serviceAccountKeyJson": "<string>",
    "maximumBytesBilled": "<string>",
    "queryTimeoutMilliseconds": "<string>"
  },
  "snowflakeConnection": {
    "account": "<string>",
    "username": "<string>",
    "password": "<string>",
    "privateKey": "<string>",
    "privateKeyPass": "<string>",
    "warehouse": "<string>",
    "database": "<string>",
    "schema": "<string>",
    "role": "<string>",
    "responseTimeoutMilliseconds": 123
  },
  "trinoConnection": {
    "server": "<string>",
    "port": 123,
    "catalog": "<string>",
    "schema": "<string>",
    "user": "<string>",
    "password": "<string>",
    "peakaKey": "<string>"
  },
  "mysqlConnection": {
    "host": "<string>",
    "port": 123,
    "database": "<string>",
    "user": "<string>",
    "password": "<string>"
  },
  "duckdbConnection": {
    "attachedDatabases": [
      {
        "name": "test_connection, _connection, test_connection_1",
        "type": "bigquery",
        "attributes": {
          "dialectName": "<string>",
          "isPool": true,
          "canPersist": true,
          "canStream": true
        },
        "bigqueryConnection": {
          "defaultProjectId": "<string>",
          "billingProjectId": "<string>",
          "location": "<string>",
          "serviceAccountKeyJson": "<string>",
          "maximumBytesBilled": "<string>",
          "queryTimeoutMilliseconds": "<string>"
        },
        "snowflakeConnection": {
          "account": "<string>",
          "username": "<string>",
          "password": "<string>",
          "privateKey": "<string>",
          "privateKeyPass": "<string>",
          "warehouse": "<string>",
          "database": "<string>",
          "schema": "<string>",
          "role": "<string>",
          "responseTimeoutMilliseconds": 123
        },
        "postgresConnection": {
          "host": "<string>",
          "port": 123,
          "databaseName": "<string>",
          "userName": "<string>",
          "password": "<string>",
          "connectionString": "<string>"
        }
      }
    ]
  },
  "motherduckConnection": {
    "accessToken": "<string>",
    "database": "<string>"
  },
  "includeTables": [
    "sales.orders",
    "finance.*"
  ],
  "excludeAllTables": false,
  "excludeTables": [
    "backup.records",
    "temp_data.*"
  ],
  "indexingStatus": "UNKNOWN",
  "indexingStatusLastUpdated": "2023-11-07T05:31:56Z"
}
'
{
  "resource": "<string>",
  "name": "<string>",
  "type": "postgres",
  "attributes": {
    "dialectName": "<string>",
    "isPool": true,
    "canPersist": true,
    "canStream": true
  },
  "postgresConnection": {
    "host": "<string>",
    "port": 123,
    "databaseName": "<string>",
    "userName": "<string>",
    "password": "<string>",
    "connectionString": "<string>"
  },
  "bigqueryConnection": {
    "defaultProjectId": "<string>",
    "billingProjectId": "<string>",
    "location": "<string>",
    "serviceAccountKeyJson": "<string>",
    "maximumBytesBilled": "<string>",
    "queryTimeoutMilliseconds": "<string>"
  },
  "snowflakeConnection": {
    "account": "<string>",
    "username": "<string>",
    "password": "<string>",
    "privateKey": "<string>",
    "privateKeyPass": "<string>",
    "warehouse": "<string>",
    "database": "<string>",
    "schema": "<string>",
    "role": "<string>",
    "responseTimeoutMilliseconds": 123
  },
  "trinoConnection": {
    "server": "<string>",
    "port": 123,
    "catalog": "<string>",
    "schema": "<string>",
    "user": "<string>",
    "password": "<string>",
    "peakaKey": "<string>"
  },
  "mysqlConnection": {
    "host": "<string>",
    "port": 123,
    "database": "<string>",
    "user": "<string>",
    "password": "<string>"
  },
  "duckdbConnection": {
    "attachedDatabases": [
      {
        "name": "test_connection, _connection, test_connection_1",
        "type": "bigquery",
        "attributes": {
          "dialectName": "<string>",
          "isPool": true,
          "canPersist": true,
          "canStream": true
        },
        "bigqueryConnection": {
          "defaultProjectId": "<string>",
          "billingProjectId": "<string>",
          "location": "<string>",
          "serviceAccountKeyJson": "<string>",
          "maximumBytesBilled": "<string>",
          "queryTimeoutMilliseconds": "<string>"
        },
        "snowflakeConnection": {
          "account": "<string>",
          "username": "<string>",
          "password": "<string>",
          "privateKey": "<string>",
          "privateKeyPass": "<string>",
          "warehouse": "<string>",
          "database": "<string>",
          "schema": "<string>",
          "role": "<string>",
          "responseTimeoutMilliseconds": 123
        },
        "postgresConnection": {
          "host": "<string>",
          "port": 123,
          "databaseName": "<string>",
          "userName": "<string>",
          "password": "<string>",
          "connectionString": "<string>"
        },
        "gcsConnection": {
          "keyId": "<string>",
          "secret": "<string>"
        },
        "s3Connection": {
          "accessKeyId": "<string>",
          "secretAccessKey": "<string>",
          "region": "us-east-1",
          "endpoint": "<string>",
          "sessionToken": "<string>"
        }
      }
    ]
  },
  "motherduckConnection": {
    "accessToken": "<string>",
    "database": "<string>"
  },
  "includeTables": [
    "sales.orders",
    "finance.*"
  ],
  "excludeAllTables": false,
  "excludeTables": [
    "backup.records",
    "temp_data.*"
  ],
  "indexingStatus": "UNKNOWN",
  "indexingStatusLastUpdated": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

organizationName
string
required

The unique identifier of the organization Standard identifier pattern for resource names

Pattern: ^[a-zA-Z0-9_-]+$
projectName
string
required

The unique identifier of the project Standard identifier pattern for resource names

Pattern: ^[a-zA-Z0-9_-]+$

Query Parameters

dryRun
boolean
default:false

Whether to test the connection without saving it

Body

application/json

Database connection configuration and metadata

resource
string

Resource path to the connection

name
string

Name of the connection

type
enum<string>

Type of database connection

Available options:
postgres,
bigquery,
snowflake,
trino,
mysql,
duckdb,
motherduck
attributes
object

Connection capabilities and configuration attributes

postgresConnection
object

PostgreSQL database connection configuration

bigqueryConnection
object

Google BigQuery database connection configuration

snowflakeConnection
object

Snowflake database connection configuration

trinoConnection
object

Trino database connection configuration

mysqlConnection
object

MySQL database connection configuration

duckdbConnection
object

DuckDB database connection configuration

motherduckConnection
object

MotherDuck database connection configuration

includeTables
string[] | null

The list of tables to include, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to include all tables.

Table name pattern supporting slashes, dots, and dashes

Pattern: ^[a-zA-Z0-9_-]+\\.(?:[a-zA-Z0-9_-]+|\\*)$
Example:
["sales.orders", "finance.*"]
excludeAllTables
boolean
default:false

Whether to exclude all tables.

excludeTables
string[] | null

The list of tables to exclude, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to exclude all tables.

Table name pattern supporting slashes, dots, and dashes

Pattern: ^[a-zA-Z0-9_-]+\\.(?:[a-zA-Z0-9_-]+|\\*)$
Example:
["backup.records", "temp_data.*"]
indexingStatus
enum<string> | null

Current indexing status of the connection. UNKNOWN means indexing has not started yet, PENDING means indexing is in progress, INDEXED means indexing finished successfully, SKIPPED means the connection is excluded from indexing, FAILED means indexing failed, RETRY means the connection was updated while indexing was in progress and will be re-indexed when the current job finishes.

Available options:
UNKNOWN,
PENDING,
INDEXED,
SKIPPED,
FAILED,
RETRY
indexingStatusLastUpdated
string<date-time> | null

ISO 8601 timestamp of when the indexing status was last updated

Response

Connection created successfully

Database connection configuration and metadata

resource
string

Resource path to the connection

name
string

Name of the connection

type
enum<string>

Type of database connection

Available options:
postgres,
bigquery,
snowflake,
trino,
mysql,
duckdb,
motherduck
attributes
object

Connection capabilities and configuration attributes

postgresConnection
object

PostgreSQL database connection configuration

bigqueryConnection
object

Google BigQuery database connection configuration

snowflakeConnection
object

Snowflake database connection configuration

trinoConnection
object

Trino database connection configuration

mysqlConnection
object

MySQL database connection configuration

duckdbConnection
object

DuckDB database connection configuration

motherduckConnection
object

MotherDuck database connection configuration

includeTables
string[] | null

The list of tables to include, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to include all tables.

Table name pattern supporting slashes, dots, and dashes

Pattern: ^[a-zA-Z0-9_-]+\\.(?:[a-zA-Z0-9_-]+|\\*)$
Example:
["sales.orders", "finance.*"]
excludeAllTables
boolean
default:false

Whether to exclude all tables.

excludeTables
string[] | null

The list of tables to exclude, in the format {dataset/schema}.{table}. The first part represents the dataset or schema, and the second part is the table name. The second part can be a literal * to exclude all tables.

Table name pattern supporting slashes, dots, and dashes

Pattern: ^[a-zA-Z0-9_-]+\\.(?:[a-zA-Z0-9_-]+|\\*)$
Example:
["backup.records", "temp_data.*"]
indexingStatus
enum<string> | null

Current indexing status of the connection. UNKNOWN means indexing has not started yet, PENDING means indexing is in progress, INDEXED means indexing finished successfully, SKIPPED means the connection is excluded from indexing, FAILED means indexing failed, RETRY means the connection was updated while indexing was in progress and will be re-indexed when the current job finishes.

Available options:
UNKNOWN,
PENDING,
INDEXED,
SKIPPED,
FAILED,
RETRY
indexingStatusLastUpdated
string<date-time> | null

ISO 8601 timestamp of when the indexing status was last updated