curl -X POST 'https://app-be.thesis.io/api/v1/integration/conversations/join-conversation' \
-H 'Authorization: Bearer YOUR_SPACE_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"conversation_id": "conv_abc123def456",
"user_prompt": "Please review the code we discussed earlier",
"research_mode": "deep_research"
}' --no-bufferimport requests
url = 'https://app-be.thesis.io/api/v1/integration/conversations/join-conversation'
headers = {
'Authorization': 'Bearer YOUR_SPACE_API_TOKEN',
'Content-Type': 'application/json'
}
data = {
'conversation_id': 'conv_abc123def456',
'user_prompt': 'Please review the code we discussed earlier',
'research_mode': 'deep_research'
}
response = requests.post(url, headers=headers, json=data)
print(response.json())const response = await fetch('https://app-be.thesis.io/api/v1/integration/conversations/join-conversation', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_SPACE_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
conversation_id: 'conv_abc123def456',
user_prompt: 'Please review the code we discussed earlier',
research_mode: 'deep_research'
})
});
const data = await response.json();
console.log(data);const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: 'conv_abc123def456',
user_prompt: 'Please review the code we discussed earlier',
research_mode: 'deep_research',
latest_event_id: 123,
x_device_id: '123'
})
};
fetch('https://app-be.thesis.io/api/v1/integration/conversations/join-conversation', 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://app-be.thesis.io/api/v1/integration/conversations/join-conversation",
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' => 'conv_abc123def456',
'user_prompt' => 'Please review the code we discussed earlier',
'research_mode' => 'deep_research',
'latest_event_id' => 123,
'x_device_id' => '123'
]),
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://app-be.thesis.io/api/v1/integration/conversations/join-conversation"
payload := strings.NewReader("{\n \"conversation_id\": \"conv_abc123def456\",\n \"user_prompt\": \"Please review the code we discussed earlier\",\n \"research_mode\": \"deep_research\",\n \"latest_event_id\": 123,\n \"x_device_id\": \"123\"\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://app-be.thesis.io/api/v1/integration/conversations/join-conversation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"conv_abc123def456\",\n \"user_prompt\": \"Please review the code we discussed earlier\",\n \"research_mode\": \"deep_research\",\n \"latest_event_id\": 123,\n \"x_device_id\": \"123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app-be.thesis.io/api/v1/integration/conversations/join-conversation")
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 \"conversation_id\": \"conv_abc123def456\",\n \"user_prompt\": \"Please review the code we discussed earlier\",\n \"research_mode\": \"deep_research\",\n \"latest_event_id\": 123,\n \"x_device_id\": \"123\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"status": "error",
"message": "Invalid request data or missing required fields",
"msg_id": "INVALID_REQUEST_DATA"
}{
"detail": "Unauthorized or invalid token"
}{
"detail": "Resource not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"status": "error",
"message": "Invalid request data or missing required fields",
"msg_id": "INVALID_REQUEST_DATA"
}Join Existing Conversation
Join an existing conversation using conversation ID and API key authentication. Allows real-time participation in ongoing conversations with streaming responses. The user prompt becomes the next message sent to the AI.
Important for streaming: Use the --no-buffer flag with cURL to enable real-time streaming output.
curl -X POST 'https://app-be.thesis.io/api/v1/integration/conversations/join-conversation' \
-H 'Authorization: Bearer YOUR_SPACE_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"conversation_id": "conv_abc123def456",
"user_prompt": "Please review the code we discussed earlier",
"research_mode": "deep_research"
}' --no-bufferimport requests
url = 'https://app-be.thesis.io/api/v1/integration/conversations/join-conversation'
headers = {
'Authorization': 'Bearer YOUR_SPACE_API_TOKEN',
'Content-Type': 'application/json'
}
data = {
'conversation_id': 'conv_abc123def456',
'user_prompt': 'Please review the code we discussed earlier',
'research_mode': 'deep_research'
}
response = requests.post(url, headers=headers, json=data)
print(response.json())const response = await fetch('https://app-be.thesis.io/api/v1/integration/conversations/join-conversation', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_SPACE_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
conversation_id: 'conv_abc123def456',
user_prompt: 'Please review the code we discussed earlier',
research_mode: 'deep_research'
})
});
const data = await response.json();
console.log(data);const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: 'conv_abc123def456',
user_prompt: 'Please review the code we discussed earlier',
research_mode: 'deep_research',
latest_event_id: 123,
x_device_id: '123'
})
};
fetch('https://app-be.thesis.io/api/v1/integration/conversations/join-conversation', 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://app-be.thesis.io/api/v1/integration/conversations/join-conversation",
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' => 'conv_abc123def456',
'user_prompt' => 'Please review the code we discussed earlier',
'research_mode' => 'deep_research',
'latest_event_id' => 123,
'x_device_id' => '123'
]),
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://app-be.thesis.io/api/v1/integration/conversations/join-conversation"
payload := strings.NewReader("{\n \"conversation_id\": \"conv_abc123def456\",\n \"user_prompt\": \"Please review the code we discussed earlier\",\n \"research_mode\": \"deep_research\",\n \"latest_event_id\": 123,\n \"x_device_id\": \"123\"\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://app-be.thesis.io/api/v1/integration/conversations/join-conversation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"conv_abc123def456\",\n \"user_prompt\": \"Please review the code we discussed earlier\",\n \"research_mode\": \"deep_research\",\n \"latest_event_id\": 123,\n \"x_device_id\": \"123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app-be.thesis.io/api/v1/integration/conversations/join-conversation")
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 \"conversation_id\": \"conv_abc123def456\",\n \"user_prompt\": \"Please review the code we discussed earlier\",\n \"research_mode\": \"deep_research\",\n \"latest_event_id\": 123,\n \"x_device_id\": \"123\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"status": "error",
"message": "Invalid request data or missing required fields",
"msg_id": "INVALID_REQUEST_DATA"
}{
"detail": "Unauthorized or invalid token"
}{
"detail": "Resource not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"status": "error",
"message": "Invalid request data or missing required fields",
"msg_id": "INVALID_REQUEST_DATA"
}Authorizations
Enter your API token in the format: Bearer <your_token_here>
Body
ID of the existing conversation to join
"conv_abc123def456"
Message to send when joining the conversation
"Please review the code we discussed earlier"
Research mode to use in the conversation. Must be one of: chat, deep_research, follow_up
chat, deep_research, follow_up "deep_research"
ID of the latest event to resume from
123
Device ID to use for the conversation
"123"
Response
Successfully joined conversation with streaming response
Server-Sent Events stream with real-time conversation updates. Events are serialized using event_to_dict() and sent as SSE format.
{
"type": "oh_event",
"data": {
"id": 1,
"timestamp": "2024-01-15T10:45:00.123Z",
"source": "user",
"message": "Please review this code",
"action": "message",
"args": {
"content": "Please review this code",
"wait_for_response": false
}
}
}
{
"type": "oh_event",
"data": {
"id": 2,
"timestamp": "2024-01-15T10:45:30.456Z",
"source": "agent",
"message": "I'll analyze the code for you...",
"action": "message",
"args": {
"content": "I'll analyze the code for you. Let me start by examining the structure...",
"wait_for_response": false
}
}
}
{
"type": "oh_event",
"data": {
"id": 3,
"timestamp": "2024-01-15T10:45:35.789Z",
"source": "agent",
"observation": "agent_state_changed",
"content": "",
"extras": {
"agent_state": "RUNNING",
"reason": "Starting code analysis"
},
"success": true
}
}