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

PropertyTypeRequiredDescription
commentstringYesHTML-formatted comment body (URL-encoded, e.g. %3Cp%3EText%3C%2Fp%3E) — mandatory
plain_textstringYesPlain-text version of the comment — mandatory (used for ETL/notifications)
cluster_idstringNoFeed cluster ID; -1=general message; required when commenting on a project thread
feed_keyintegerNoFeed/project key; 0 or absent = no specific feed
message_typestringNoM=main, R=reply, F=reassign, RA=reply-all
message_statusstringNoInitial read status: N=not-read, R=read
reason_codestringNoReason code key from /task/v1/comments/configs
reason_textstringNoDisplay label for the reason code
assign_storestringNoTarget unit/store ID to assign the comment to
assign_profilestringNoTarget profile ID to assign to
assign_deptstringNoTarget department ID to assign to
assign_userstringNoTarget user ID to assign to
assign_textstringNoDisplay text for the assignment (e.g. user name + store)
assign_detailsstringNoJSON string of assignment detail metadata (e.g. [{"USER_INFO":[],...}])
msg_parent_idintegerNoParent message ID for reply chain positioning
msg_main_idintegerNoRoot/thread message ID
linkstringNoURL to embed in the comment
internalstringNoInternal-only flag: Y=internal, -1=not set
from_externalstringNoSource indicator for externally originated comments
login_auth_tokenstringNoLogin 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

PropertyTypeRequiredDescription
statusstringYesAlways "ER" for error responses
errorCodestringYesApplication-level error code (e.g. E202, E105, E404)
responsestringYesHuman-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

PropertyTypeRequiredDescription
statusstringYesAlways "ER" for error responses
errorCodestringYesApplication-level error code (e.g. E202, E105, E404)
responsestringYesHuman-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

PropertyTypeRequiredDescription
statusstringYesAlways "ER" for error responses
errorCodestringYesApplication-level error code (e.g. E202, E105, E404)
responsestringYesHuman-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"
}