Create a native Slack thread and start a child session in it
curl --request POST \
--url http://localhost:3000/api/v1/sessions/create-thread \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"cleanContext": true,
"effort": "<string>",
"from": "<string>",
"idempotencyKey": "<string>",
"model": "<string>",
"provider": "<string>",
"session": "<string>",
"thinking": "<string>",
"workspaceFrom": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/sessions/create-thread"
payload = {
"message": "<string>",
"cleanContext": True,
"effort": "<string>",
"from": "<string>",
"idempotencyKey": "<string>",
"model": "<string>",
"provider": "<string>",
"session": "<string>",
"thinking": "<string>",
"workspaceFrom": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
cleanContext: true,
effort: '<string>',
from: '<string>',
idempotencyKey: '<string>',
model: '<string>',
provider: '<string>',
session: '<string>',
thinking: '<string>',
workspaceFrom: '<string>'
})
};
fetch('http://localhost:3000/api/v1/sessions/create-thread', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/sessions/create-thread",
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>',
'cleanContext' => true,
'effort' => '<string>',
'from' => '<string>',
'idempotencyKey' => '<string>',
'model' => '<string>',
'provider' => '<string>',
'session' => '<string>',
'thinking' => '<string>',
'workspaceFrom' => '<string>'
]),
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 := "http://localhost:3000/api/v1/sessions/create-thread"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"cleanContext\": true,\n \"effort\": \"<string>\",\n \"from\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"session\": \"<string>\",\n \"thinking\": \"<string>\",\n \"workspaceFrom\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/v1/sessions/create-thread")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"cleanContext\": true,\n \"effort\": \"<string>\",\n \"from\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"session\": \"<string>\",\n \"thinking\": \"<string>\",\n \"workspaceFrom\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/sessions/create-thread")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"cleanContext\": true,\n \"effort\": \"<string>\",\n \"from\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"session\": \"<string>\",\n \"thinking\": \"<string>\",\n \"workspaceFrom\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"actionId": "thread.create",
"child": {
"cleanContext": true,
"effortOverride": "<string>",
"modelOverride": "<string>",
"providerOverride": "<string>",
"status": "pending_root_delivery",
"thinkingLevel": "<string>",
"workspaceAgentId": "<string>"
},
"executionMode": "durable",
"idempotencyKey": "<string>",
"initiatorSession": {
"sessionKey": "<string>",
"sessionName": "<string>"
},
"origin": {
"canonicalChatId": "<string>",
"channel": "<string>"
},
"parentSession": {
"sessionKey": "<string>",
"sessionName": "<string>"
},
"publishPending": true,
"publishedNow": true,
"queued": true,
"requestId": "<string>",
"slack": {
"accountId": "<string>",
"canonicalChatId": "<string>",
"channelId": "<string>",
"instanceId": "<string>"
},
"status": "queued",
"title": "<string>",
"nextAttemptAt": 123,
"replayed": true
}sessions
Create a native Slack thread and start a child session in it
POST
/
api
/
v1
/
sessions
/
create-thread
Create a native Slack thread and start a child session in it
curl --request POST \
--url http://localhost:3000/api/v1/sessions/create-thread \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"cleanContext": true,
"effort": "<string>",
"from": "<string>",
"idempotencyKey": "<string>",
"model": "<string>",
"provider": "<string>",
"session": "<string>",
"thinking": "<string>",
"workspaceFrom": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/sessions/create-thread"
payload = {
"message": "<string>",
"cleanContext": True,
"effort": "<string>",
"from": "<string>",
"idempotencyKey": "<string>",
"model": "<string>",
"provider": "<string>",
"session": "<string>",
"thinking": "<string>",
"workspaceFrom": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
cleanContext: true,
effort: '<string>',
from: '<string>',
idempotencyKey: '<string>',
model: '<string>',
provider: '<string>',
session: '<string>',
thinking: '<string>',
workspaceFrom: '<string>'
})
};
fetch('http://localhost:3000/api/v1/sessions/create-thread', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/sessions/create-thread",
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>',
'cleanContext' => true,
'effort' => '<string>',
'from' => '<string>',
'idempotencyKey' => '<string>',
'model' => '<string>',
'provider' => '<string>',
'session' => '<string>',
'thinking' => '<string>',
'workspaceFrom' => '<string>'
]),
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 := "http://localhost:3000/api/v1/sessions/create-thread"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"cleanContext\": true,\n \"effort\": \"<string>\",\n \"from\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"session\": \"<string>\",\n \"thinking\": \"<string>\",\n \"workspaceFrom\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/v1/sessions/create-thread")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"cleanContext\": true,\n \"effort\": \"<string>\",\n \"from\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"session\": \"<string>\",\n \"thinking\": \"<string>\",\n \"workspaceFrom\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/sessions/create-thread")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"cleanContext\": true,\n \"effort\": \"<string>\",\n \"from\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"model\": \"<string>\",\n \"provider\": \"<string>\",\n \"session\": \"<string>\",\n \"thinking\": \"<string>\",\n \"workspaceFrom\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"actionId": "thread.create",
"child": {
"cleanContext": true,
"effortOverride": "<string>",
"modelOverride": "<string>",
"providerOverride": "<string>",
"status": "pending_root_delivery",
"thinkingLevel": "<string>",
"workspaceAgentId": "<string>"
},
"executionMode": "durable",
"idempotencyKey": "<string>",
"initiatorSession": {
"sessionKey": "<string>",
"sessionName": "<string>"
},
"origin": {
"canonicalChatId": "<string>",
"channel": "<string>"
},
"parentSession": {
"sessionKey": "<string>",
"sessionName": "<string>"
},
"publishPending": true,
"publishedNow": true,
"queued": true,
"requestId": "<string>",
"slack": {
"accountId": "<string>",
"canonicalChatId": "<string>",
"channelId": "<string>",
"instanceId": "<string>"
},
"status": "queued",
"title": "<string>",
"nextAttemptAt": 123,
"replayed": true
}Body
application/json
Stable key for this thread request: sending it again returns the request it created instead of creating another thread, whatever state that thread is in now. Without it, the same message and options from the same session within 2 minutes count as a repeat only while that request is still queued, root_delivered, starting or open; one that failed or was closed is not repeated
Response
Success — body conforms to the @Returns schema.