Start Chat
curl --request POST \
--url https://ds.cominty.com/chat \
--header 'Content-Type: application/json' \
--header 'x-cominty-token: <api-key>' \
--data '
{
"message": {
"content": "<string>",
"file_ids": [
"<string>"
],
"source_ids": [
123
],
"document_ids": [
"<string>"
],
"disabled_tools": []
},
"options": {
"agent_id": "<string>",
"user_id": "<string>"
},
"name": "<string>"
}
'import requests
url = "https://ds.cominty.com/chat"
payload = {
"message": {
"content": "<string>",
"file_ids": ["<string>"],
"source_ids": [123],
"document_ids": ["<string>"],
"disabled_tools": []
},
"options": {
"agent_id": "<string>",
"user_id": "<string>"
},
"name": "<string>"
}
headers = {
"x-cominty-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-cominty-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
content: '<string>',
file_ids: ['<string>'],
source_ids: [123],
document_ids: ['<string>'],
disabled_tools: []
},
options: {agent_id: '<string>', user_id: '<string>'},
name: '<string>'
})
};
fetch('https://ds.cominty.com/chat', 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://ds.cominty.com/chat",
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' => [
'content' => '<string>',
'file_ids' => [
'<string>'
],
'source_ids' => [
123
],
'document_ids' => [
'<string>'
],
'disabled_tools' => [
]
],
'options' => [
'agent_id' => '<string>',
'user_id' => '<string>'
],
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-cominty-token: <api-key>"
],
]);
$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://ds.cominty.com/chat"
payload := strings.NewReader("{\n \"message\": {\n \"content\": \"<string>\",\n \"file_ids\": [\n \"<string>\"\n ],\n \"source_ids\": [\n 123\n ],\n \"document_ids\": [\n \"<string>\"\n ],\n \"disabled_tools\": []\n },\n \"options\": {\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\"\n },\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-cominty-token", "<api-key>")
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://ds.cominty.com/chat")
.header("x-cominty-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": {\n \"content\": \"<string>\",\n \"file_ids\": [\n \"<string>\"\n ],\n \"source_ids\": [\n 123\n ],\n \"document_ids\": [\n \"<string>\"\n ],\n \"disabled_tools\": []\n },\n \"options\": {\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\"\n },\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ds.cominty.com/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-cominty-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": {\n \"content\": \"<string>\",\n \"file_ids\": [\n \"<string>\"\n ],\n \"source_ids\": [\n 123\n ],\n \"document_ids\": [\n \"<string>\"\n ],\n \"disabled_tools\": []\n },\n \"options\": {\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\"\n },\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"live": true,
"agent": {
"id": "<string>",
"name": "<string>"
},
"starred": true,
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"content": "<string>",
"questions": [
{
"prompt": "<string>",
"options": [
"<string>"
]
}
],
"live": true,
"status": "<string>",
"events": [
{}
],
"structured_output": {},
"files": [
{
"id": "<string>",
"name": "<string>",
"size": 123,
"mimetype": "<string>",
"url": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}API Reference
Start Chat
POST
/
chat
Start Chat
curl --request POST \
--url https://ds.cominty.com/chat \
--header 'Content-Type: application/json' \
--header 'x-cominty-token: <api-key>' \
--data '
{
"message": {
"content": "<string>",
"file_ids": [
"<string>"
],
"source_ids": [
123
],
"document_ids": [
"<string>"
],
"disabled_tools": []
},
"options": {
"agent_id": "<string>",
"user_id": "<string>"
},
"name": "<string>"
}
'import requests
url = "https://ds.cominty.com/chat"
payload = {
"message": {
"content": "<string>",
"file_ids": ["<string>"],
"source_ids": [123],
"document_ids": ["<string>"],
"disabled_tools": []
},
"options": {
"agent_id": "<string>",
"user_id": "<string>"
},
"name": "<string>"
}
headers = {
"x-cominty-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-cominty-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
content: '<string>',
file_ids: ['<string>'],
source_ids: [123],
document_ids: ['<string>'],
disabled_tools: []
},
options: {agent_id: '<string>', user_id: '<string>'},
name: '<string>'
})
};
fetch('https://ds.cominty.com/chat', 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://ds.cominty.com/chat",
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' => [
'content' => '<string>',
'file_ids' => [
'<string>'
],
'source_ids' => [
123
],
'document_ids' => [
'<string>'
],
'disabled_tools' => [
]
],
'options' => [
'agent_id' => '<string>',
'user_id' => '<string>'
],
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-cominty-token: <api-key>"
],
]);
$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://ds.cominty.com/chat"
payload := strings.NewReader("{\n \"message\": {\n \"content\": \"<string>\",\n \"file_ids\": [\n \"<string>\"\n ],\n \"source_ids\": [\n 123\n ],\n \"document_ids\": [\n \"<string>\"\n ],\n \"disabled_tools\": []\n },\n \"options\": {\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\"\n },\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-cominty-token", "<api-key>")
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://ds.cominty.com/chat")
.header("x-cominty-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": {\n \"content\": \"<string>\",\n \"file_ids\": [\n \"<string>\"\n ],\n \"source_ids\": [\n 123\n ],\n \"document_ids\": [\n \"<string>\"\n ],\n \"disabled_tools\": []\n },\n \"options\": {\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\"\n },\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ds.cominty.com/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-cominty-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": {\n \"content\": \"<string>\",\n \"file_ids\": [\n \"<string>\"\n ],\n \"source_ids\": [\n 123\n ],\n \"document_ids\": [\n \"<string>\"\n ],\n \"disabled_tools\": []\n },\n \"options\": {\n \"agent_id\": \"<string>\",\n \"user_id\": \"<string>\"\n },\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"live": true,
"agent": {
"id": "<string>",
"name": "<string>"
},
"starred": true,
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"content": "<string>",
"questions": [
{
"prompt": "<string>",
"options": [
"<string>"
]
}
],
"live": true,
"status": "<string>",
"events": [
{}
],
"structured_output": {},
"files": [
{
"id": "<string>",
"name": "<string>",
"size": 123,
"mimetype": "<string>",
"url": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Your Cominty API token.
Body
application/json
⌘I