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>",
"connection_type": "postgres",
"status": "PENDING",
"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": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}data_connections
Create Data Connection
Create data connection
POST
/
assets
/
data
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>",
"connection_type": "postgres",
"status": "PENDING",
"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": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
}Authorizations
Body
application/json
Request body for creating a data connection.
Now supports inline credentials which will be stored as secrets automatically.
Response
Successful Response
Full data connection representation.
Was this page helpful?

