Sessions
Send Session Message
Create a message for an existing session and queue a follow-up job
POST
/
session
/
{sessionId}
/
messages
cURL
curl -s -X POST \
"https://api.tembo.io/session/${SESSION_ID}/messages" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"content": "Please add a regression test for this change."}'import requests
url = "https://tembo.example.com/api/public-api/session/{sessionId}/messages"
payload = {
"content": "<string>",
"jsonContent": "<string>",
"artifactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pullRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mcpServers": ["<string>"],
"agentOptions": {}
}
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({
content: '<string>',
jsonContent: '<string>',
artifactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pullRequestId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
mcpServers: ['<string>'],
agentOptions: {}
})
};
fetch('https://tembo.example.com/api/public-api/session/{sessionId}/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://tembo.example.com/api/public-api/session/{sessionId}/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([
'content' => '<string>',
'jsonContent' => '<string>',
'artifactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pullRequestId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'mcpServers' => [
'<string>'
],
'agentOptions' => [
]
]),
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://tembo.example.com/api/public-api/session/{sessionId}/messages"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"jsonContent\": \"<string>\",\n \"artifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pullRequestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"mcpServers\": [\n \"<string>\"\n ],\n \"agentOptions\": {}\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("https://tembo.example.com/api/public-api/session/{sessionId}/messages")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"jsonContent\": \"<string>\",\n \"artifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pullRequestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"mcpServers\": [\n \"<string>\"\n ],\n \"agentOptions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tembo.example.com/api/public-api/session/{sessionId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"jsonContent\": \"<string>\",\n \"artifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pullRequestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"mcpServers\": [\n \"<string>\"\n ],\n \"agentOptions\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "<string>",
"content": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"isQueued": true
},
"job": {
"id": "<string>",
"task": "<string>"
},
"session": {
"id": "<string>",
"title": "<string>"
},
"hotPath": {
"providerSessionId": "<string>",
"activeProviderTurnId": "<string>",
"queuedTurnId": "<string>",
"transport": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}Path Parameters
ID of the session to continue
Body
application/json
Session message payload
Follow-up instructions for the session
Minimum string length:
1Structured message content serialized as JSON
Artifact to associate with the follow-up
Pull request to associate with the follow-up
MCP server identifiers available to the agent
Agent runtime options for this follow-up
Show child attributes
Show child attributes
Was this page helpful?
⌘I
cURL
curl -s -X POST \
"https://api.tembo.io/session/${SESSION_ID}/messages" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d '{"content": "Please add a regression test for this change."}'import requests
url = "https://tembo.example.com/api/public-api/session/{sessionId}/messages"
payload = {
"content": "<string>",
"jsonContent": "<string>",
"artifactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pullRequestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mcpServers": ["<string>"],
"agentOptions": {}
}
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({
content: '<string>',
jsonContent: '<string>',
artifactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pullRequestId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
mcpServers: ['<string>'],
agentOptions: {}
})
};
fetch('https://tembo.example.com/api/public-api/session/{sessionId}/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://tembo.example.com/api/public-api/session/{sessionId}/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([
'content' => '<string>',
'jsonContent' => '<string>',
'artifactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pullRequestId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'mcpServers' => [
'<string>'
],
'agentOptions' => [
]
]),
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://tembo.example.com/api/public-api/session/{sessionId}/messages"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"jsonContent\": \"<string>\",\n \"artifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pullRequestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"mcpServers\": [\n \"<string>\"\n ],\n \"agentOptions\": {}\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("https://tembo.example.com/api/public-api/session/{sessionId}/messages")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"jsonContent\": \"<string>\",\n \"artifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pullRequestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"mcpServers\": [\n \"<string>\"\n ],\n \"agentOptions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tembo.example.com/api/public-api/session/{sessionId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"jsonContent\": \"<string>\",\n \"artifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pullRequestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"mcpServers\": [\n \"<string>\"\n ],\n \"agentOptions\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "<string>",
"content": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"isQueued": true
},
"job": {
"id": "<string>",
"task": "<string>"
},
"session": {
"id": "<string>",
"title": "<string>"
},
"hotPath": {
"providerSessionId": "<string>",
"activeProviderTurnId": "<string>",
"queuedTurnId": "<string>",
"transport": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}