List a team's datasources
curl --request GET \
--url https://api.teamduo.ai/teams/{teamId}/datasources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.teamduo.ai/teams/{teamId}/datasources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.teamduo.ai/teams/{teamId}/datasources', 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.teamduo.ai/teams/{teamId}/datasources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.teamduo.ai/teams/{teamId}/datasources"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.teamduo.ai/teams/{teamId}/datasources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamduo.ai/teams/{teamId}/datasources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"teamId": "<string>",
"name": "<string>",
"type": "POSTGRES",
"status": "PENDING",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"exposedTableCount": 123,
"connectionMode": "<string>",
"host": "<string>",
"port": 123,
"database": "<string>",
"username": "<string>",
"sslMode": "<string>",
"config": {},
"accessMode": "ROLE_BASED",
"minRole": "OWNER",
"lastTestedAt": "2023-11-07T05:31:56Z",
"lastError": "<string>"
}
]{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "SCOPE_REQUIRED",
"requiredScope": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Endpoints
List a team's datasources
The databases you may query on this team, filtered to the ones your role or explicit access reaches.
GET
/
teams
/
{teamId}
/
datasources
List a team's datasources
curl --request GET \
--url https://api.teamduo.ai/teams/{teamId}/datasources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.teamduo.ai/teams/{teamId}/datasources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.teamduo.ai/teams/{teamId}/datasources', 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.teamduo.ai/teams/{teamId}/datasources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.teamduo.ai/teams/{teamId}/datasources"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.teamduo.ai/teams/{teamId}/datasources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamduo.ai/teams/{teamId}/datasources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"teamId": "<string>",
"name": "<string>",
"type": "POSTGRES",
"status": "PENDING",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"exposedTableCount": 123,
"connectionMode": "<string>",
"host": "<string>",
"port": 123,
"database": "<string>",
"username": "<string>",
"sslMode": "<string>",
"config": {},
"accessMode": "ROLE_BASED",
"minRole": "OWNER",
"lastTestedAt": "2023-11-07T05:31:56Z",
"lastError": "<string>"
}
]{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "SCOPE_REQUIRED",
"requiredScope": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
An API key (sk_live_...) created under Settings → API keys, or a short-lived JWT access token from a browser session. A key only reaches the scope it was granted; see API keys and scopes.
Path Parameters
Team id from GET /teams.
Response
Datasources on this team.
Available options:
POSTGRES, MONGODB, BIGQUERY Available options:
PENDING, CONNECTED, ERROR, DISABLED The database name, or the BigQuery project id.
Non-secret, per-type settings.
Available options:
ROLE_BASED, EXPLICIT Available options:
OWNER, ADMIN, MEMBER