Documentation Index
Fetch the complete documentation index at: https://docs.chamelio.ai/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
POST /tasks/{task_id}/comment
Authentication
This endpoint requires authentication via API key. Include your API key in the X-API-Key header:
X-API-Key: ca_your_api_key_here
Path Parameters
| Parameter | Type | Required | Description |
|---|
task_id | integer | Yes | Unique identifier for the task |
Request Body
The request body must be a JSON object with the following fields:
Required Fields
| Field | Type | Description |
|---|
comment | string | Comment text content |
Optional Fields
| Field | Type | Description |
|---|
user_email | string | Email of the user posting the comment (defaults to API key owner) |
mention_user_ids | array[integer] | List of user IDs to mention in the comment |
reply_to | integer | Activity log ID of an existing comment to reply to (for threading) |
attachments | array[object] | Files to attach to the comment (uploaded automatically) |
Attachment Object
Each item in the attachments array must contain:
| Field | Type | Description |
|---|
filename | string | Filename including extension (e.g., "report.pdf") |
base64_content | string | Base64-encoded file content |
Request Example
curl -X POST "https://platform.chamelio.ai/tasks/12345/comment" \
-H "X-API-Key: ca_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"comment": "The contract has been reviewed and looks good.",
"user_email": "reviewer@example.com",
"mention_user_ids": [42, 57],
"attachments": [
{
"filename": "review-notes.pdf",
"base64_content": "JVBERi0xLjQKMSAwIG9iago..."
}
]
}'
Response
Success Response
Status Code: 200 OK
{
"success": true,
"activity_log_id": 98765,
"message": "Comment created successfully"
}
Response Fields
| Field | Type | Description |
|---|
success | boolean | Whether the comment was created successfully |
activity_log_id | integer | ID of the created activity log entry (use this as reply_to for threaded replies) |
message | string | Success confirmation message |
Error Responses
401 Unauthorized
Returned when authentication fails. See the authentication errors section for details.
{
"detail": "Invalid API key"
}
404 Not Found
Returned when the task doesn’t exist or you don’t have access to it.
{
"detail": "Task not found"
}
422 Validation Error
Returned when the request body is invalid or required fields are missing.
{
"detail": [
{
"loc": ["body", "comment"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
500 Internal Server Error
Returned when the comment creation fails due to a server error.
{
"detail": "Failed to create comment"
}
Notes
The activity_log_id returned in the response can be used as the reply_to value in subsequent requests to create threaded conversations on a task.
When a comment is posted, a flows.tasks.commented webhook event is triggered, allowing external systems to react to new comments in real time.
Attachments are sent as base64-encoded content in the request body. For large files, consider the impact on request size and timeout limits.
Use Cases
This endpoint is useful for:
- Automated status updates - Post comments from external systems when events occur (e.g., approval from a third-party tool)
- Threaded conversations - Build reply chains using the
reply_to field with activity_log_id values
- File sharing - Attach documents or reports to task comments programmatically
- Cross-system notifications - Mention specific users to alert them about updates from integrated systems