cURL
curl --request POST \
--url https://api.chartbrew.com/team/{team_id}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"team_id": 123,
"host": "<string>",
"port": "<string>",
"username": "<string>",
"password": "<string>",
"options": {},
"authentication": {
"token": "<string>",
"user": "<string>",
"pass": "<string>"
},
"firebaseServiceAccount": {},
"ssl": false,
"sslMode": "require",
"schema": {}
}
'import requests
url = "https://api.chartbrew.com/team/{team_id}/connections"
payload = {
"name": "<string>",
"team_id": 123,
"host": "<string>",
"port": "<string>",
"username": "<string>",
"password": "<string>",
"options": {},
"authentication": {
"token": "<string>",
"user": "<string>",
"pass": "<string>"
},
"firebaseServiceAccount": {},
"ssl": False,
"sslMode": "require",
"schema": {}
}
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({
name: '<string>',
team_id: 123,
host: '<string>',
port: '<string>',
username: '<string>',
password: '<string>',
options: {},
authentication: {token: '<string>', user: '<string>', pass: '<string>'},
firebaseServiceAccount: {},
ssl: false,
sslMode: 'require',
schema: {}
})
};
fetch('https://api.chartbrew.com/team/{team_id}/connections', 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.chartbrew.com/team/{team_id}/connections",
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([
'name' => '<string>',
'team_id' => 123,
'host' => '<string>',
'port' => '<string>',
'username' => '<string>',
'password' => '<string>',
'options' => [
],
'authentication' => [
'token' => '<string>',
'user' => '<string>',
'pass' => '<string>'
],
'firebaseServiceAccount' => [
],
'ssl' => false,
'sslMode' => 'require',
'schema' => [
]
]),
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.chartbrew.com/team/{team_id}/connections"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"team_id\": 123,\n \"host\": \"<string>\",\n \"port\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"options\": {},\n \"authentication\": {\n \"token\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\"\n },\n \"firebaseServiceAccount\": {},\n \"ssl\": false,\n \"sslMode\": \"require\",\n \"schema\": {}\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.chartbrew.com/team/{team_id}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"team_id\": 123,\n \"host\": \"<string>\",\n \"port\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"options\": {},\n \"authentication\": {\n \"token\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\"\n },\n \"firebaseServiceAccount\": {},\n \"ssl\": false,\n \"sslMode\": \"require\",\n \"schema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/team/{team_id}/connections")
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 \"name\": \"<string>\",\n \"team_id\": 123,\n \"host\": \"<string>\",\n \"port\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"options\": {},\n \"authentication\": {\n \"token\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\"\n },\n \"firebaseServiceAccount\": {},\n \"ssl\": false,\n \"sslMode\": \"require\",\n \"schema\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"team_id": 123,
"project_ids": [
"<string>"
],
"oauth_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "mongodb",
"subType": "timescaledb",
"active": true,
"host": "<string>",
"dbName": "<string>",
"port": "<string>",
"username": "<string>",
"password": "<string>",
"srv": false,
"options": {},
"connectionString": "<string>",
"authentication": {
"type": "bearer_token",
"token": "<string>",
"user": "<string>",
"pass": "<string>"
},
"firebaseServiceAccount": {},
"ssl": false,
"sslMode": "require",
"sslCa": "<string>",
"sslCert": "<string>",
"sslKey": "<string>",
"schema": {}
}Connections
Create a connection
Create a new connection inside a team
POST
/
team
/
{team_id}
/
connections
cURL
curl --request POST \
--url https://api.chartbrew.com/team/{team_id}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"team_id": 123,
"host": "<string>",
"port": "<string>",
"username": "<string>",
"password": "<string>",
"options": {},
"authentication": {
"token": "<string>",
"user": "<string>",
"pass": "<string>"
},
"firebaseServiceAccount": {},
"ssl": false,
"sslMode": "require",
"schema": {}
}
'import requests
url = "https://api.chartbrew.com/team/{team_id}/connections"
payload = {
"name": "<string>",
"team_id": 123,
"host": "<string>",
"port": "<string>",
"username": "<string>",
"password": "<string>",
"options": {},
"authentication": {
"token": "<string>",
"user": "<string>",
"pass": "<string>"
},
"firebaseServiceAccount": {},
"ssl": False,
"sslMode": "require",
"schema": {}
}
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({
name: '<string>',
team_id: 123,
host: '<string>',
port: '<string>',
username: '<string>',
password: '<string>',
options: {},
authentication: {token: '<string>', user: '<string>', pass: '<string>'},
firebaseServiceAccount: {},
ssl: false,
sslMode: 'require',
schema: {}
})
};
fetch('https://api.chartbrew.com/team/{team_id}/connections', 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.chartbrew.com/team/{team_id}/connections",
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([
'name' => '<string>',
'team_id' => 123,
'host' => '<string>',
'port' => '<string>',
'username' => '<string>',
'password' => '<string>',
'options' => [
],
'authentication' => [
'token' => '<string>',
'user' => '<string>',
'pass' => '<string>'
],
'firebaseServiceAccount' => [
],
'ssl' => false,
'sslMode' => 'require',
'schema' => [
]
]),
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.chartbrew.com/team/{team_id}/connections"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"team_id\": 123,\n \"host\": \"<string>\",\n \"port\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"options\": {},\n \"authentication\": {\n \"token\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\"\n },\n \"firebaseServiceAccount\": {},\n \"ssl\": false,\n \"sslMode\": \"require\",\n \"schema\": {}\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.chartbrew.com/team/{team_id}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"team_id\": 123,\n \"host\": \"<string>\",\n \"port\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"options\": {},\n \"authentication\": {\n \"token\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\"\n },\n \"firebaseServiceAccount\": {},\n \"ssl\": false,\n \"sslMode\": \"require\",\n \"schema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/team/{team_id}/connections")
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 \"name\": \"<string>\",\n \"team_id\": 123,\n \"host\": \"<string>\",\n \"port\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"options\": {},\n \"authentication\": {\n \"token\": \"<string>\",\n \"user\": \"<string>\",\n \"pass\": \"<string>\"\n },\n \"firebaseServiceAccount\": {},\n \"ssl\": false,\n \"sslMode\": \"require\",\n \"schema\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"team_id": 123,
"project_ids": [
"<string>"
],
"oauth_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "mongodb",
"subType": "timescaledb",
"active": true,
"host": "<string>",
"dbName": "<string>",
"port": "<string>",
"username": "<string>",
"password": "<string>",
"srv": false,
"options": {},
"connectionString": "<string>",
"authentication": {
"type": "bearer_token",
"token": "<string>",
"user": "<string>",
"pass": "<string>"
},
"firebaseServiceAccount": {},
"ssl": false,
"sslMode": "require",
"sslCa": "<string>",
"sslCert": "<string>",
"sslKey": "<string>",
"schema": {}
}If your connection requires SSL certificates, you’ll need to upload them using the update connection files endpoint after creating the connection.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the team
Body
application/json
Available options:
mongodb, api, mysql, postgres, realtimedb, firestore, googleAnalytics, customerio Used for connections based on main types
Available options:
timescaledb, supabasedb, rdsPostgres, rdsMysql, api, mongodb, api, mysql, postgres, realtimedb, firestore, googleAnalytics, customerio Used for MongoDB, Postgres, and MySQL connections
Used for API connections
Show child attributes
Show child attributes
JSON object containing the Firebase service account credentials
Used for Postgres and MySQL. This gets populated automatically whenever the connection is used in a chart.
Response
Created connection
Available options:
mongodb, api, mysql, postgres, realtimedb, firestore, googleAnalytics, customerio Used for connections based on main types
Available options:
timescaledb, supabasedb, rdsPostgres, rdsMysql, api, mongodb, api, mysql, postgres, realtimedb, firestore, googleAnalytics, customerio Used for MongoDB, Postgres, and MySQL connections
Used for API connections
Show child attributes
Show child attributes
JSON object containing the Firebase service account credentials