curl --request POST \
--url https://api.example.com/assets/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_type": "redshift",
"credentials": {
"password": "securepassword123",
"username": "analytics_user"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "redshift-cluster.amazonaws.com",
"port": 5439,
"selected_tables": {
"public": [
"customers",
"orders",
"products"
]
},
"ssl_mode": "require"
},
"description": "Production Redshift database for customer analytics",
"name": "Customer Analytics DB",
"resource_uri": "customer-analytics-db",
"tags": [
"production",
"analytics",
"pii"
]
}
'import requests
url = "https://api.example.com/assets/data"
payload = {
"connection_type": "redshift",
"credentials": {
"password": "securepassword123",
"username": "analytics_user"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "redshift-cluster.amazonaws.com",
"port": 5439,
"selected_tables": { "public": ["customers", "orders", "products"] },
"ssl_mode": "require"
},
"description": "Production Redshift database for customer analytics",
"name": "Customer Analytics DB",
"resource_uri": "customer-analytics-db",
"tags": ["production", "analytics", "pii"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_type: 'redshift',
credentials: {password: 'securepassword123', username: 'analytics_user'},
database_config: {
auth_type: 'basic',
database: 'analytics',
db_schema: 'public',
host: 'redshift-cluster.amazonaws.com',
port: 5439,
selected_tables: {public: ['customers', 'orders', 'products']},
ssl_mode: 'require'
},
description: 'Production Redshift database for customer analytics',
name: 'Customer Analytics DB',
resource_uri: 'customer-analytics-db',
tags: ['production', 'analytics', 'pii']
})
};
fetch('https://api.example.com/assets/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/assets/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_type' => 'redshift',
'credentials' => [
'password' => 'securepassword123',
'username' => 'analytics_user'
],
'database_config' => [
'auth_type' => 'basic',
'database' => 'analytics',
'db_schema' => 'public',
'host' => 'redshift-cluster.amazonaws.com',
'port' => 5439,
'selected_tables' => [
'public' => [
'customers',
'orders',
'products'
]
],
'ssl_mode' => 'require'
],
'description' => 'Production Redshift database for customer analytics',
'name' => 'Customer Analytics DB',
'resource_uri' => 'customer-analytics-db',
'tags' => [
'production',
'analytics',
'pii'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/assets/data"
payload := strings.NewReader("{\n \"connection_type\": \"redshift\",\n \"credentials\": {\n \"password\": \"securepassword123\",\n \"username\": \"analytics_user\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"redshift-cluster.amazonaws.com\",\n \"port\": 5439,\n \"selected_tables\": {\n \"public\": [\n \"customers\",\n \"orders\",\n \"products\"\n ]\n },\n \"ssl_mode\": \"require\"\n },\n \"description\": \"Production Redshift database for customer analytics\",\n \"name\": \"Customer Analytics DB\",\n \"resource_uri\": \"customer-analytics-db\",\n \"tags\": [\n \"production\",\n \"analytics\",\n \"pii\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/assets/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_type\": \"redshift\",\n \"credentials\": {\n \"password\": \"securepassword123\",\n \"username\": \"analytics_user\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"redshift-cluster.amazonaws.com\",\n \"port\": 5439,\n \"selected_tables\": {\n \"public\": [\n \"customers\",\n \"orders\",\n \"products\"\n ]\n },\n \"ssl_mode\": \"require\"\n },\n \"description\": \"Production Redshift database for customer analytics\",\n \"name\": \"Customer Analytics DB\",\n \"resource_uri\": \"customer-analytics-db\",\n \"tags\": [\n \"production\",\n \"analytics\",\n \"pii\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/assets/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_type\": \"redshift\",\n \"credentials\": {\n \"password\": \"securepassword123\",\n \"username\": \"analytics_user\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"redshift-cluster.amazonaws.com\",\n \"port\": 5439,\n \"selected_tables\": {\n \"public\": [\n \"customers\",\n \"orders\",\n \"products\"\n ]\n },\n \"ssl_mode\": \"require\"\n },\n \"description\": \"Production Redshift database for customer analytics\",\n \"name\": \"Customer Analytics DB\",\n \"resource_uri\": \"customer-analytics-db\",\n \"tags\": [\n \"production\",\n \"analytics\",\n \"pii\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"resource_uri": "<string>",
"name": "<string>",
"organization_id": "<string>",
"project_id": "<string>",
"owner_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"updated_by": "<string>",
"type": "data",
"status_message": "<string>",
"description": "<string>",
"tags": [],
"database_config": {
"host": "<string>",
"port": 123,
"database": "<string>",
"auth_type": "basic",
"ssl_mode": "disable",
"selected_tables": [
{
"database_name": "<string>",
"schemas": [
{
"schema_name": "<string>",
"tables": [
"<string>"
],
"views": []
}
]
}
],
"options": {}
},
"storage_config": {
"provider": "<string>",
"bucket": "<string>",
"region": "<string>",
"endpoint_url": "<string>"
},
"filesystem_config": {
"path": "<string>",
"protocol": "<string>",
"auth_required": false
},
"secret_names": []
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}Create Data Connection
Create data connection
curl --request POST \
--url https://api.example.com/assets/data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_type": "redshift",
"credentials": {
"password": "securepassword123",
"username": "analytics_user"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "redshift-cluster.amazonaws.com",
"port": 5439,
"selected_tables": {
"public": [
"customers",
"orders",
"products"
]
},
"ssl_mode": "require"
},
"description": "Production Redshift database for customer analytics",
"name": "Customer Analytics DB",
"resource_uri": "customer-analytics-db",
"tags": [
"production",
"analytics",
"pii"
]
}
'import requests
url = "https://api.example.com/assets/data"
payload = {
"connection_type": "redshift",
"credentials": {
"password": "securepassword123",
"username": "analytics_user"
},
"database_config": {
"auth_type": "basic",
"database": "analytics",
"db_schema": "public",
"host": "redshift-cluster.amazonaws.com",
"port": 5439,
"selected_tables": { "public": ["customers", "orders", "products"] },
"ssl_mode": "require"
},
"description": "Production Redshift database for customer analytics",
"name": "Customer Analytics DB",
"resource_uri": "customer-analytics-db",
"tags": ["production", "analytics", "pii"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_type: 'redshift',
credentials: {password: 'securepassword123', username: 'analytics_user'},
database_config: {
auth_type: 'basic',
database: 'analytics',
db_schema: 'public',
host: 'redshift-cluster.amazonaws.com',
port: 5439,
selected_tables: {public: ['customers', 'orders', 'products']},
ssl_mode: 'require'
},
description: 'Production Redshift database for customer analytics',
name: 'Customer Analytics DB',
resource_uri: 'customer-analytics-db',
tags: ['production', 'analytics', 'pii']
})
};
fetch('https://api.example.com/assets/data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/assets/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_type' => 'redshift',
'credentials' => [
'password' => 'securepassword123',
'username' => 'analytics_user'
],
'database_config' => [
'auth_type' => 'basic',
'database' => 'analytics',
'db_schema' => 'public',
'host' => 'redshift-cluster.amazonaws.com',
'port' => 5439,
'selected_tables' => [
'public' => [
'customers',
'orders',
'products'
]
],
'ssl_mode' => 'require'
],
'description' => 'Production Redshift database for customer analytics',
'name' => 'Customer Analytics DB',
'resource_uri' => 'customer-analytics-db',
'tags' => [
'production',
'analytics',
'pii'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/assets/data"
payload := strings.NewReader("{\n \"connection_type\": \"redshift\",\n \"credentials\": {\n \"password\": \"securepassword123\",\n \"username\": \"analytics_user\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"redshift-cluster.amazonaws.com\",\n \"port\": 5439,\n \"selected_tables\": {\n \"public\": [\n \"customers\",\n \"orders\",\n \"products\"\n ]\n },\n \"ssl_mode\": \"require\"\n },\n \"description\": \"Production Redshift database for customer analytics\",\n \"name\": \"Customer Analytics DB\",\n \"resource_uri\": \"customer-analytics-db\",\n \"tags\": [\n \"production\",\n \"analytics\",\n \"pii\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/assets/data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_type\": \"redshift\",\n \"credentials\": {\n \"password\": \"securepassword123\",\n \"username\": \"analytics_user\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"redshift-cluster.amazonaws.com\",\n \"port\": 5439,\n \"selected_tables\": {\n \"public\": [\n \"customers\",\n \"orders\",\n \"products\"\n ]\n },\n \"ssl_mode\": \"require\"\n },\n \"description\": \"Production Redshift database for customer analytics\",\n \"name\": \"Customer Analytics DB\",\n \"resource_uri\": \"customer-analytics-db\",\n \"tags\": [\n \"production\",\n \"analytics\",\n \"pii\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/assets/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_type\": \"redshift\",\n \"credentials\": {\n \"password\": \"securepassword123\",\n \"username\": \"analytics_user\"\n },\n \"database_config\": {\n \"auth_type\": \"basic\",\n \"database\": \"analytics\",\n \"db_schema\": \"public\",\n \"host\": \"redshift-cluster.amazonaws.com\",\n \"port\": 5439,\n \"selected_tables\": {\n \"public\": [\n \"customers\",\n \"orders\",\n \"products\"\n ]\n },\n \"ssl_mode\": \"require\"\n },\n \"description\": \"Production Redshift database for customer analytics\",\n \"name\": \"Customer Analytics DB\",\n \"resource_uri\": \"customer-analytics-db\",\n \"tags\": [\n \"production\",\n \"analytics\",\n \"pii\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"resource_uri": "<string>",
"name": "<string>",
"organization_id": "<string>",
"project_id": "<string>",
"owner_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"updated_by": "<string>",
"type": "data",
"status_message": "<string>",
"description": "<string>",
"tags": [],
"database_config": {
"host": "<string>",
"port": 123,
"database": "<string>",
"auth_type": "basic",
"ssl_mode": "disable",
"selected_tables": [
{
"database_name": "<string>",
"schemas": [
{
"schema_name": "<string>",
"tables": [
"<string>"
],
"views": []
}
]
}
],
"options": {}
},
"storage_config": {
"provider": "<string>",
"bucket": "<string>",
"region": "<string>",
"endpoint_url": "<string>"
},
"filesystem_config": {
"path": "<string>",
"protocol": "<string>",
"auth_required": false
},
"secret_names": []
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
Request body for creating a data connection.
Now supports inline credentials which will be stored as secrets automatically.
1 - 255^[a-zA-Z0-9][a-zA-Z0-9 _.:-]*$Data connection types.
postgres, redshift, mysql, bigquery, snowflake, databricks, couchbase, oracle, hive, mongodb, s3, gcs, minio, nfs, smb Credentials for authentication. These will be securely stored as secrets.
Show child attributes
Show child attributes
Custom kebab-case name for the resource URI (e.g., 'customer-db'). Auto-generated from name if omitted. The full URI is constructed as {type}:{org_id}:{scope}:{name}.
^[a-z0-9-]+$1000Configuration for database connections.
Show child attributes
Show child attributes
Configuration for object storage connections.
Show child attributes
Show child attributes
Configuration for file system connections.
Show child attributes
Show child attributes
Response
Successful Response
Full data connection representation.
Data connection types.
postgres, redshift, mysql, bigquery, snowflake, databricks, couchbase, oracle, hive, mongodb, s3, gcs, minio, nfs, smb Status of a data connection.
PENDING, ACTIVE, ERROR, DISABLED Deprecated: use created_by instead. Will be removed in a future release.
Configuration for database connections.
Show child attributes
Show child attributes
Configuration for object storage connections.
Show child attributes
Show child attributes
Configuration for file system connections.
Show child attributes
Show child attributes
Was this page helpful?

