List data sources
curl --request GET \
--url https://api.corebasehq.com/api/v1/sources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.corebasehq.com/api/v1/sources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.corebasehq.com/api/v1/sources', 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.corebasehq.com/api/v1/sources",
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.corebasehq.com/api/v1/sources"
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.corebasehq.com/api/v1/sources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.corebasehq.com/api/v1/sources")
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{
"data": [
{
"id": "<string>",
"name": "<string>",
"kind": "<string>",
"project_id": "<string>"
}
],
"next_cursor": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}Endpoints
List data sources
Lists the data sources the agent can reach in a project (the default
project unless project_id is given). Use the returned id values as
source_ids in a chat completion to scope a request to a subset. Requires
the sources_read permission.
GET
/
api
/
v1
/
sources
List data sources
curl --request GET \
--url https://api.corebasehq.com/api/v1/sources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.corebasehq.com/api/v1/sources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.corebasehq.com/api/v1/sources', 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.corebasehq.com/api/v1/sources",
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.corebasehq.com/api/v1/sources"
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.corebasehq.com/api/v1/sources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.corebasehq.com/api/v1/sources")
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{
"data": [
{
"id": "<string>",
"name": "<string>",
"kind": "<string>",
"project_id": "<string>"
}
],
"next_cursor": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}Returns the queryable data sources connected to a project — databases,
REST/GraphQL APIs, SaaS connectors, and on-prem CoreMCP sources. Use the
id
values to scope a chat request via source_ids. Project ids come from
List projects.
Scope a chat request
from openai import OpenAI
client = OpenAI(api_key="cb_live_xxx", base_url="https://api.corebasehq.com/api/v1")
stream = client.chat.completions.create(
model="corebase",
messages=[{"role": "user", "content": "Open invoices over 30 days?"}],
stream=True,
extra_body={
"project_id": "p1a2…", # run inside this workspace
"source_ids": ["9b1c…"], # only the ERP database
},
)
Authorizations
A cb_live_ API token, created in the panel under API Tokens.
Query Parameters
List sources in this project. Omit for the default project.
Maximum sources per page.
Required range:
1 <= x <= 200Opaque cursor from a previous page's next_cursor.