Add a new comment (with optional file attachments)
POST /task/v1/comments/add
Operation id: addComment
Description
Adds a new comment to a feed/cluster. Attachment file extensions are validated against the domain-configured ATTACHMENT_TYPES before the service is called.
Always-injected from session (not overridable): domain_id, user_id, store_id, dept_id, profile_id, time_zone_long.
Both snake_case and camelCase param names are accepted (e.g. feed_key or feedKey).
Auth header note: Use X-reflexis-csrf-token-X (NOT the legacy x-authtoken). Requires ROS_UNIT_DOMAIN line-of-sight authorization.
Tags: MyWorkComments
Security
- ApiKeyHeader (apiKey)
- APIGEE API key header validated by VerifyAPIKey policy.
- AuthTokenHeader (apiKey)
- Session authentication token validated server-side against the user session store.
Responses
200 — Success — {status: OK, comment_data[]} for normal add/reply.
For message_type=RA (reply-all) → {status: OK, message: "Message added successfully"}.
Content type: application/json
400 — E125 — invalid attachment type
Content type: application/json
401 — Missing or invalid X-reflexis-csrf-token-X session token
Content type: application/json
500 — Unexpected server-side error
Content type: application/json
Request body
Required: Yes
multipart/form-data
Schema
| Property | Type | Required | Description |
|---|---|---|---|
comment | string | Yes | HTML-formatted comment body (URL-encoded, e.g. %3Cp%3EText%3C%2Fp%3E) — mandatory |
plain_text | string | Yes | Plain-text version of the comment — mandatory (used for ETL/notifications) |
cluster_id | string | No | Feed cluster ID; -1=general message; required when commenting on a project thread |
feed_key | integer | No | Feed/project key; 0 or absent = no specific feed |
message_type | string | No | M=main, R=reply, F=reassign, RA=reply-all |
message_status | string | No | Initial read status: N=not-read, R=read |
reason_code | string | No | Reason code key from /task/v1/comments/configs |
reason_text | string | No | Display label for the reason code |
assign_store | string | No | Target unit/store ID to assign the comment to |
assign_profile | string | No | Target profile ID to assign to |
assign_dept | string | No | Target department ID to assign to |
assign_user | string | No | Target user ID to assign to |
assign_text | string | No | Display text for the assignment (e.g. user name + store) |
assign_details | string | No | JSON string of assignment detail metadata (e.g. [{"USER_INFO":[],...}]) |
msg_parent_id | integer | No | Parent message ID for reply chain positioning |
msg_main_id | integer | No | Root/thread message ID |
link | string | No | URL to embed in the comment |
internal | string | No | Internal-only flag: Y=internal, -1=not set |
from_external | string | No | Source indicator for externally originated comments |
login_auth_token | string | No | Login auth token override |
{
"type": "object",
"required": [
"comment",
"plain_text"
],
"properties": {
"comment": {
"type": "string",
"description": "HTML-formatted comment body (URL-encoded, e.g. %3Cp%3EText%3C%2Fp%3E) — mandatory"
},
"plain_text": {
"type": "string",
"description": "Plain-text version of the comment — mandatory (used for ETL/notifications)"
},
"cluster_id": {
"type": "string",
"description": "Feed cluster ID; -1=general message; required when commenting on a project thread",
"default": "-1"
},
"feed_key": {
"type": "integer",
"description": "Feed/project key; 0 or absent = no specific feed",
"default": 0
},
"message_type": {
"type": "string",
"description": "M=main, R=reply, F=reassign, RA=reply-all",
"enum": [
"M",
"R",
"F",
"RA"
],
"default": "M"
},
"message_status": {
"type": "string",
"description": "Initial read status: N=not-read, R=read",
"enum": [
"N",
"R"
],
"default": "N"
},
"reason_code": {
"type": "string",
"description": "Reason code key from /task/v1/comments/configs"
},
"reason_text": {
"type": "string",
"description": "Display label for the reason code"
},
"assign_store": {
"type": "string",
"description": "Target unit/store ID to assign the comment to",
"default": "-1"
},
"assign_profile": {
"type": "string",
"description": "Target profile ID to assign to",
"default": "-1"
},
"assign_dept": {
"type": "string",
"description": "Target department ID to assign to",
"default": "-1"
},
"assign_user": {
"type": "string",
"description": "Target user ID to assign to",
"default": "-1"
},
"assign_text": {
"type": "string",
"description": "Display text for the assignment (e.g. user name + store)"
},
"assign_details": {
"type": "string",
"description": "JSON string of assignment detail metadata (e.g. [{\"USER_INFO\":[],...}])"
},
"msg_parent_id": {
"type": "integer",
"description": "Parent message ID for reply chain positioning",
"default": 0
},
"msg_main_id": {
"type": "integer",
"description": "Root/thread message ID",
"default": 0
},
"link": {
"type": "string",
"description": "URL to embed in the comment"
},
"internal": {
"type": "string",
"description": "Internal-only flag: Y=internal, -1=not set",
"default": "-1"
},
"from_external": {
"type": "string",
"description": "Source indicator for externally originated comments"
},
"login_auth_token": {
"type": "string",
"description": "Login auth token override",
"default": "-1"
}
}
}
Response models
200 — Success — {status: OK, comment_data[]} for normal add/reply.
For message_type=RA (reply-all) → {status: OK, message: "Message added successfully"}.
Content type: application/json
Schema
JSON object (structure varies by endpoint).
{
"type": "object",
"description": "JSON object (structure varies by endpoint)."
}
400 — E125 — invalid attachment type
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
status | string | Yes | Always "ER" for error responses |
errorCode | string | Yes | Application-level error code (e.g. E202, E105, E404) |
response | string | Yes | Human-readable error message |
{
"type": "object",
"example": {
"status": "ER",
"errorCode": "E202",
"response": "User session is invalid"
},
"required": [
"status",
"errorCode",
"response"
],
"properties": {
"status": {
"type": "string",
"description": "Always \"ER\" for error responses",
"enum": [
"ER"
]
},
"errorCode": {
"type": "string",
"description": "Application-level error code (e.g. E202, E105, E404)"
},
"response": {
"type": "string",
"description": "Human-readable error message"
}
}
}
401 — Missing or invalid X-reflexis-csrf-token-X session token
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
status | string | Yes | Always "ER" for error responses |
errorCode | string | Yes | Application-level error code (e.g. E202, E105, E404) |
response | string | Yes | Human-readable error message |
{
"type": "object",
"example": {
"status": "ER",
"errorCode": "E202",
"response": "User session is invalid"
},
"required": [
"status",
"errorCode",
"response"
],
"properties": {
"status": {
"type": "string",
"description": "Always \"ER\" for error responses",
"enum": [
"ER"
]
},
"errorCode": {
"type": "string",
"description": "Application-level error code (e.g. E202, E105, E404)"
},
"response": {
"type": "string",
"description": "Human-readable error message"
}
}
}
Example:
{
"status": "ER",
"errorCode": "E202",
"response": "User session is invalid"
}
500 — Unexpected server-side error
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
status | string | Yes | Always "ER" for error responses |
errorCode | string | Yes | Application-level error code (e.g. E202, E105, E404) |
response | string | Yes | Human-readable error message |
{
"type": "object",
"example": {
"status": "ER",
"errorCode": "E202",
"response": "User session is invalid"
},
"required": [
"status",
"errorCode",
"response"
],
"properties": {
"status": {
"type": "string",
"description": "Always \"ER\" for error responses",
"enum": [
"ER"
]
},
"errorCode": {
"type": "string",
"description": "Application-level error code (e.g. E202, E105, E404)"
},
"response": {
"type": "string",
"description": "Human-readable error message"
}
}
}
Example:
{
"status": "ER",
"errorCode": "E302",
"response": "Internal server error"
}