Send Follow-up
curl --request POST \
--url https://api.example.com/api/v1/tasks/{id}/messagesimport requests
url = "https://api.example.com/api/v1/tasks/{id}/messages"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/tasks/{id}/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://api.example.com/api/v1/tasks/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/tasks/{id}/messages"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/tasks/{id}/messages")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/tasks/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyTask API
Send Follow-up
Send a follow-up message to an existing task
POST
/
api
/
v1
/
tasks
/
{id}
/
messages
Send Follow-up
curl --request POST \
--url https://api.example.com/api/v1/tasks/{id}/messagesimport requests
url = "https://api.example.com/api/v1/tasks/{id}/messages"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/tasks/{id}/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://api.example.com/api/v1/tasks/{id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/tasks/{id}/messages"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/tasks/{id}/messages")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/tasks/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodySend Follow-up Message
Send a follow-up message to an existing task’s session. This maintains conversation context, allowing you to continue the dialogue without creating a new task. The endpoint returns immediately and execution runs in the background. If the task’s session has expired, it is automatically restored - no need to create a new task.Request
JSON Request (without files)
POST /api/v1/tasks/{id}/messages
Authorization: Bearer {api_key}
Content-Type: application/json
{
"message": "Can you explain that in more detail?"
}
Multipart Request (with files)
POST /api/v1/tasks/{id}/messages
Authorization: Bearer {api_key}
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The follow-up message to send |
files | file(s) | No | Files to upload (max 20 files, 50MB each). ZIP files are auto-extracted. |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique task identifier |
File Upload Behavior
When files are uploaded:- Files are saved to the task’s workspace under
uploads/ - ZIP files are automatically extracted, preserving directory structure
- A file list is prepended to your message so the AI knows the files are available
- The AI can then read and process these files using workspace tools
Response
Returns JSON immediately. Execution runs in the background.{
"success": true,
"data": {
"status": "running"
}
}
GET /api/v1/tasks/:id/stream to receive the response. The stream will replay all conversation history (including your follow-up) then deliver live events.
Session Auto-Restore
If the task’s session has expired (e.g., due to inactivity timeout), the follow-up endpoint automatically:- Creates a new session
- Loads the conversation history into agent memory
- Copies preserved workspace files
- Continues execution with your new message
status event with “Restoring session…” during this process. No special handling is needed on your end.
Examples
Simple Follow-up (JSON)
# 1. Send the follow-up
curl -s -X POST https://api.sigmic.ai/api/v1/tasks/YOUR_TASK_ID/messages \
-H "Authorization: Bearer sigmic_your_key_here" \
-H "Content-Type: application/json" \
-d '{"message": "Now multiply that by 3"}'
# 2. Stream the response
curl -N https://api.sigmic.ai/api/v1/tasks/YOUR_TASK_ID/stream \
-H "Authorization: Bearer sigmic_your_key_here"
const taskId = 'c37c1d78-4d23-4e53-949a-ddd775f25e01';
// 1. Send the follow-up
await fetch(
`https://api.sigmic.ai/api/v1/tasks/${taskId}/messages`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer sigmic_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ message: 'Now multiply that by 3' })
}
);
// 2. Stream the response (includes full history + new response)
const streamResponse = await fetch(
`https://api.sigmic.ai/api/v1/tasks/${taskId}/stream`,
{ headers: { 'Authorization': 'Bearer sigmic_your_key_here' } }
);
const reader = streamResponse.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
import requests
import json
task_id = 'c37c1d78-4d23-4e53-949a-ddd775f25e01'
# 1. Send the follow-up
requests.post(
f'https://api.sigmic.ai/api/v1/tasks/{task_id}/messages',
headers={
'Authorization': 'Bearer sigmic_your_key_here',
'Content-Type': 'application/json'
},
json={'message': 'Now multiply that by 3'}
)
# 2. Stream the response
stream = requests.get(
f'https://api.sigmic.ai/api/v1/tasks/{task_id}/stream',
headers={'Authorization': 'Bearer sigmic_your_key_here'},
stream=True
)
for line in stream.iter_lines():
if line:
print(line.decode('utf-8'))
Follow-up with File Upload
curl -s -X POST https://api.sigmic.ai/api/v1/tasks/YOUR_TASK_ID/messages \
-H "Authorization: Bearer sigmic_your_key_here" \
-F "message=Analyze this additional data file" \
-F "files=@data.csv" \
-F "files=@config.json"
const taskId = 'c37c1d78-4d23-4e53-949a-ddd775f25e01';
const formData = new FormData();
formData.append('message', 'Analyze this additional data file');
formData.append('files', dataFile);
formData.append('files', configFile);
await fetch(
`https://api.sigmic.ai/api/v1/tasks/${taskId}/messages`,
{
method: 'POST',
headers: { 'Authorization': 'Bearer sigmic_your_key_here' },
body: formData
}
);
// Connect to stream for the response...
import requests
task_id = 'c37c1d78-4d23-4e53-949a-ddd775f25e01'
with open('data.csv', 'rb') as f1, open('config.json', 'rb') as f2:
requests.post(
f'https://api.sigmic.ai/api/v1/tasks/{task_id}/messages',
headers={'Authorization': 'Bearer sigmic_your_key_here'},
data={'message': 'Analyze this additional data file'},
files=[
('files', ('data.csv', f1, 'text/csv')),
('files', ('config.json', f2, 'application/json'))
]
)
# Connect to stream for the response...
Upload ZIP Archive
ZIP files are automatically extracted. Use this to upload entire project directories:# Create a ZIP of your project
zip -r project.zip src/ tests/ package.json
# Upload and ask for analysis
curl -s -X POST https://api.sigmic.ai/api/v1/tasks/{task_id}/messages \
-H "Authorization: Bearer sigmic_your_key_here" \
-F "message=Review this project for security issues" \
-F "files=@project.zip"
[Files uploaded to workspace]
- uploads/src/index.js
- uploads/src/utils.js
- uploads/tests/test.js
- uploads/package.json
Review this project for security issues
Important Notes
Follow-up messages use the same conversation context as the original task, so the agent has full memory of the previous conversation. If the session expired, it is automatically restored.
After sending a follow-up, connect to
GET /tasks/:id/stream to receive the response. The stream replays the full conversation history followed by live events, so you always get the complete picture.Errors
| Code | Description |
|---|---|
AUTH_REQUIRED | No authentication provided |
INVALID_API_KEY | Invalid or expired API key |
NOT_FOUND | Task with the specified ID was not found |
VALIDATION_ERROR | Missing message in request body |