Add a single message
curl --request POST \
--url https://connie.ai/api/ai-chat/messages \
--header 'Content-Type: application/json' \
--cookie session= \
--data '
{
"conversation_id": "<string>",
"role": "user",
"content": "<string>",
"model": "<string>",
"tool_calls": "<array>",
"tool_results": "<array>",
"metadata": {},
"tokens_used": 123,
"workspace_id": "<string>",
"title": "<string>",
"source": "<string>"
}
'import requests
url = "https://connie.ai/api/ai-chat/messages"
payload = {
"conversation_id": "<string>",
"role": "user",
"content": "<string>",
"model": "<string>",
"tool_calls": "<array>",
"tool_results": "<array>",
"metadata": {},
"tokens_used": 123,
"workspace_id": "<string>",
"title": "<string>",
"source": "<string>"
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: '<string>',
role: 'user',
content: '<string>',
model: '<string>',
tool_calls: '<array>',
tool_results: '<array>',
metadata: {},
tokens_used: 123,
workspace_id: '<string>',
title: '<string>',
source: '<string>'
})
};
fetch('https://connie.ai/api/ai-chat/messages', 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://connie.ai/api/ai-chat/messages",
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([
'conversation_id' => '<string>',
'role' => 'user',
'content' => '<string>',
'model' => '<string>',
'tool_calls' => '<array>',
'tool_results' => '<array>',
'metadata' => [
],
'tokens_used' => 123,
'workspace_id' => '<string>',
'title' => '<string>',
'source' => '<string>'
]),
CURLOPT_COOKIE => "session=",
CURLOPT_HTTPHEADER => [
"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://connie.ai/api/ai-chat/messages"
payload := strings.NewReader("{\n \"conversation_id\": \"<string>\",\n \"role\": \"user\",\n \"content\": \"<string>\",\n \"model\": \"<string>\",\n \"tool_calls\": \"<array>\",\n \"tool_results\": \"<array>\",\n \"metadata\": {},\n \"tokens_used\": 123,\n \"workspace_id\": \"<string>\",\n \"title\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "session=")
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://connie.ai/api/ai-chat/messages")
.header("cookie", "session=")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"<string>\",\n \"role\": \"user\",\n \"content\": \"<string>\",\n \"model\": \"<string>\",\n \"tool_calls\": \"<array>\",\n \"tool_results\": \"<array>\",\n \"metadata\": {},\n \"tokens_used\": 123,\n \"workspace_id\": \"<string>\",\n \"title\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connie.ai/api/ai-chat/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"<string>\",\n \"role\": \"user\",\n \"content\": \"<string>\",\n \"model\": \"<string>\",\n \"tool_calls\": \"<array>\",\n \"tool_results\": \"<array>\",\n \"metadata\": {},\n \"tokens_used\": 123,\n \"workspace_id\": \"<string>\",\n \"title\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "<string>",
"conversation_id": "<string>",
"role": "user",
"content": "<string>",
"model": "<string>",
"tool_calls": "<array>",
"tool_results": "<array>",
"tokens_used": 123,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z"
}
}AI Chat
Add a single message
Adds a message to a conversation. Supports lazy conversation creation if workspace_id, title, and source are provided alongside conversation_id.
POST
/
ai-chat
/
messages
Add a single message
curl --request POST \
--url https://connie.ai/api/ai-chat/messages \
--header 'Content-Type: application/json' \
--cookie session= \
--data '
{
"conversation_id": "<string>",
"role": "user",
"content": "<string>",
"model": "<string>",
"tool_calls": "<array>",
"tool_results": "<array>",
"metadata": {},
"tokens_used": 123,
"workspace_id": "<string>",
"title": "<string>",
"source": "<string>"
}
'import requests
url = "https://connie.ai/api/ai-chat/messages"
payload = {
"conversation_id": "<string>",
"role": "user",
"content": "<string>",
"model": "<string>",
"tool_calls": "<array>",
"tool_results": "<array>",
"metadata": {},
"tokens_used": 123,
"workspace_id": "<string>",
"title": "<string>",
"source": "<string>"
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: '<string>',
role: 'user',
content: '<string>',
model: '<string>',
tool_calls: '<array>',
tool_results: '<array>',
metadata: {},
tokens_used: 123,
workspace_id: '<string>',
title: '<string>',
source: '<string>'
})
};
fetch('https://connie.ai/api/ai-chat/messages', 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://connie.ai/api/ai-chat/messages",
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([
'conversation_id' => '<string>',
'role' => 'user',
'content' => '<string>',
'model' => '<string>',
'tool_calls' => '<array>',
'tool_results' => '<array>',
'metadata' => [
],
'tokens_used' => 123,
'workspace_id' => '<string>',
'title' => '<string>',
'source' => '<string>'
]),
CURLOPT_COOKIE => "session=",
CURLOPT_HTTPHEADER => [
"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://connie.ai/api/ai-chat/messages"
payload := strings.NewReader("{\n \"conversation_id\": \"<string>\",\n \"role\": \"user\",\n \"content\": \"<string>\",\n \"model\": \"<string>\",\n \"tool_calls\": \"<array>\",\n \"tool_results\": \"<array>\",\n \"metadata\": {},\n \"tokens_used\": 123,\n \"workspace_id\": \"<string>\",\n \"title\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "session=")
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://connie.ai/api/ai-chat/messages")
.header("cookie", "session=")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"<string>\",\n \"role\": \"user\",\n \"content\": \"<string>\",\n \"model\": \"<string>\",\n \"tool_calls\": \"<array>\",\n \"tool_results\": \"<array>\",\n \"metadata\": {},\n \"tokens_used\": 123,\n \"workspace_id\": \"<string>\",\n \"title\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connie.ai/api/ai-chat/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"<string>\",\n \"role\": \"user\",\n \"content\": \"<string>\",\n \"model\": \"<string>\",\n \"tool_calls\": \"<array>\",\n \"tool_results\": \"<array>\",\n \"metadata\": {},\n \"tokens_used\": 123,\n \"workspace_id\": \"<string>\",\n \"title\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "<string>",
"conversation_id": "<string>",
"role": "user",
"content": "<string>",
"model": "<string>",
"tool_calls": "<array>",
"tool_results": "<array>",
"tokens_used": 123,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Body
application/json
Available options:
user, assistant, tool For lazy conversation creation
For lazy conversation creation
For lazy conversation creation
Response
201 - application/json
Message created
Show child attributes
Show child attributes