Skip to main content
POST
/
api
/
v1
/
tasks
/
{id}
/
messages
Send Follow-up
curl --request POST \
  --url https://api.example.com/api/v1/tasks/{id}/messages

Documentation Index

Fetch the complete documentation index at: https://docs.sigmic.ai/llms.txt

Use this file to discover all available pages before exploring further.

Send 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
FieldTypeRequiredDescription
messagestringYesThe follow-up message to send
filesfile(s)NoFiles to upload (max 20 files, 50MB each). ZIP files are auto-extracted.

Path Parameters

ParameterTypeDescription
idstringThe unique task identifier

File Upload Behavior

When files are uploaded:
  1. Files are saved to the task’s workspace under uploads/
  2. ZIP files are automatically extracted, preserving directory structure
  3. A file list is prepended to your message so the AI knows the files are available
  4. 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"
  }
}
After sending the follow-up, connect to 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:
  1. Creates a new session
  2. Loads the conversation history into agent memory
  3. Copies preserved workspace files
  4. Continues execution with your new message
The stream will emit a 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"

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"

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"
The AI will see:
[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

CodeDescription
AUTH_REQUIREDNo authentication provided
INVALID_API_KEYInvalid or expired API key
NOT_FOUNDTask with the specified ID was not found
VALIDATION_ERRORMissing message in request body