curl --request POST \
--url https://charts.basedash.com/api/public/organizations/{orgId}/chats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/chats"
payload = { "message": "<string>" }
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({message: '<string>'})
};
fetch('https://charts.basedash.com/api/public/organizations/{orgId}/chats', 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://charts.basedash.com/api/public/organizations/{orgId}/chats",
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([
'message' => '<string>'
]),
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://charts.basedash.com/api/public/organizations/{orgId}/chats"
payload := strings.NewReader("{\n \"message\": \"<string>\"\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://charts.basedash.com/api/public/organizations/{orgId}/chats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/organizations/{orgId}/chats")
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 \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"chat": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"source": "api",
"memberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"userMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"data": {
"chat": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"source": "api",
"memberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"userMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"data": {
"chat": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"source": "api",
"memberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"userMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}Start a chat
Sends a message to the AI agent in a new chat, like sending the first message in the app. The response includes the new chat, your message, and the assistant message. The assistant responds asynchronously by default: use the wait parameter to receive the finished response directly, or poll the assistant message (or stream its events) after receiving HTTP 202. To continue the conversation, use “Send a follow-up message”.
curl --request POST \
--url https://charts.basedash.com/api/public/organizations/{orgId}/chats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/chats"
payload = { "message": "<string>" }
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({message: '<string>'})
};
fetch('https://charts.basedash.com/api/public/organizations/{orgId}/chats', 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://charts.basedash.com/api/public/organizations/{orgId}/chats",
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([
'message' => '<string>'
]),
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://charts.basedash.com/api/public/organizations/{orgId}/chats"
payload := strings.NewReader("{\n \"message\": \"<string>\"\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://charts.basedash.com/api/public/organizations/{orgId}/chats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/organizations/{orgId}/chats")
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 \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"chat": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"source": "api",
"memberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"userMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"data": {
"chat": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"source": "api",
"memberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"userMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"data": {
"chat": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"source": "api",
"memberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"userMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": "<string>",
"chatId": "<string>",
"parentId": "<string>",
"text": "<string>",
"parts": [
{
"id": "<string>",
"content": "<string>",
"externalId": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"charts": [
{
"chartId": "<string>",
"chartVersionId": "<string>",
"title": "<string>",
"imageUrl": "<string>",
"mimeType": "<string>",
"width": 123,
"height": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}Authorizations
API key authentication using Bearer token format: Bearer <basedash_api_key>
Headers
A unique key (up to 255 characters) that makes retries safe: repeating a request with the same key returns the original result instead of creating a duplicate.
255Path Parameters
Organization ID
Query Parameters
Maximum number of seconds (1-300) to hold the request open while the assistant responds. If the response finishes in time the completed message is returned; otherwise the request returns HTTP 202 with the in-progress message. Omit to return immediately.
1 <= x <= 300Body
The message to send to the AI agent, e.g. a question about your data. Maximum 10,000 characters.
1 - 10000Response
The Idempotency-Key was already used, so the existing chat is returned instead of creating a duplicate
Show child attributes
Show child attributes
Was this page helpful?