curl --request GET \
--url https://api.teamduo.ai/teams/{teamId}/datasources/{id}/schema \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.teamduo.ai/teams/{teamId}/datasources/{id}/schema"
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/{id}/schema', 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/{id}/schema",
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/{id}/schema"
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/{id}/schema")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamduo.ai/teams/{teamId}/datasources/{id}/schema")
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>",
"name": "<string>",
"type": "POSTGRES",
"vocabulary": {
"schema": "<string>",
"table": "<string>",
"queryLanguage": "<string>"
},
"tables": [
{
"schema": "<string>",
"table": "<string>",
"columns": [
{
"name": "<string>",
"type": "<string>",
"nullable": true,
"primaryKey": true,
"references": "<unknown>",
"description": "<string>",
"stats": {
"nullFrac": 123,
"distinctCount": 123,
"values": [
"<unknown>"
],
"range": "<unknown>",
"signals": [
"<string>"
]
}
}
],
"description": "<string>",
"documentation": {
"summary": "<string>",
"statements": [
"<string>"
],
"examples": "<string>",
"publishedAt": "2023-11-07T05:31:56Z"
},
"estimatedRows": 123,
"columnsRestricted": true,
"indexes": [
"<unknown>"
]
}
],
"schemaCapturedAt": "2023-11-07T05:31:56Z",
"profileCapturedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "SCOPE_REQUIRED",
"requiredScope": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "This datasource has not been introspected yet.",
"code": "NOT_CONNECTED"
}Describe a datasource
The exposed tables and columns on one datasource, with types, keys, row estimates, profiled statistics, and any published documentation. Call this before writing a query — it carries the context column names don’t.
full=1 instead returns the complete introspected schema, including tables nobody has exposed — the list an admin picks exposure from. It requires your account to manage this datasource (an admin/owner team role), independent of your key’s scopes, and 409s with NOT_CONNECTED if the datasource has never been introspected.
curl --request GET \
--url https://api.teamduo.ai/teams/{teamId}/datasources/{id}/schema \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.teamduo.ai/teams/{teamId}/datasources/{id}/schema"
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/{id}/schema', 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/{id}/schema",
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/{id}/schema"
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/{id}/schema")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teamduo.ai/teams/{teamId}/datasources/{id}/schema")
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>",
"name": "<string>",
"type": "POSTGRES",
"vocabulary": {
"schema": "<string>",
"table": "<string>",
"queryLanguage": "<string>"
},
"tables": [
{
"schema": "<string>",
"table": "<string>",
"columns": [
{
"name": "<string>",
"type": "<string>",
"nullable": true,
"primaryKey": true,
"references": "<unknown>",
"description": "<string>",
"stats": {
"nullFrac": 123,
"distinctCount": 123,
"values": [
"<unknown>"
],
"range": "<unknown>",
"signals": [
"<string>"
]
}
}
],
"description": "<string>",
"documentation": {
"summary": "<string>",
"statements": [
"<string>"
],
"examples": "<string>",
"publishedAt": "2023-11-07T05:31:56Z"
},
"estimatedRows": 123,
"columnsRestricted": true,
"indexes": [
"<unknown>"
]
}
],
"schemaCapturedAt": "2023-11-07T05:31:56Z",
"profileCapturedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "SCOPE_REQUIRED",
"requiredScope": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "This datasource has not been introspected yet.",
"code": "NOT_CONNECTED"
}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
Datasource id from GET /teams/{teamId}/datasources.
Query Parameters
Pass 1 for the full introspected schema instead of the exposed subset. Requires a manage-level team role.
1 Response
The exposed subset (default), or the full introspected schema when full=1.
POSTGRES, MONGODB, BIGQUERY What this source calls its own concepts — write a query using these words, not "schema"/"table" by default.
Show child attributes
Show child attributes
Show child attributes
Show child attributes