Create a new comment for a task or bord, with access checks, optional label/meta data, viewers update, mentions, email/push notifications, logging, and realtime update publishing.
The method creates a comment linked either to a task or to a bord. If the comment contains links to other tasks, related task links can be created automatically. If personal_ids are provided, personal notifications and push notifications are generated for mentioned users.
The number in the URL path (/1/) is the organization identifier — referred to as account_id.
This value must match the account associated with the provided session_id or token.
This endpoint supports both:
POST https://api.doboard.com/42/comment_add
Request body:
{
"task_id": 101,
"comment": "Please check this task.",
"status": "ACTIVE",
"label_id": 5,
"viewers_ids": "5,8,12",
"personal_ids": "8",
"session_id": "abc123xyz"
}
In this example:
42 is the organization/account ID.task_id=101 creates a comment for task 101.comment contains the comment HTML/text.status=ACTIVE creates an active comment.label_id=5 links the comment to label 5 if the label exists.viewers_ids defines users who should be added as viewers.personal_ids defines users who should receive personal mention notifications.session_id=abc123xyz is used for authentication.Either
task_idortrack_idis required.
Empty comments are allowed only whenhas_filesis provided.
Required
The method requires a valid session or guest/public access context:
session_id – for authenticated userstoken – for guest/public accessAccess rules:
projects_users.If the account ID in the URL does not match the account tied to the session or token, the request will be rejected.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id |
string | Yes* | – | Authenticated user session ID. |
token |
string | Yes* | – | Guest/public access token, if public access is enabled. |
task_id |
int | Yes** | – | Task ID to add the comment to. |
track_id |
int | Yes** | – | Bord ID to add the comment to. |
comment |
string | Yes*** | – | Comment content. HTML is formatted/sanitized before saving. |
has_files |
int / boolean | No | – | Allows creating an empty comment when files are being attached. |
status |
string | No | ACTIVE |
Comment status. Allowed values: ACTIVE, REMOVED. |
label_id |
int | No | null |
Optional label ID. If the label does not exist, it is ignored and saved as null. |
meta |
string | No | "" |
Additional metadata stored with the comment. |
viewers_ids |
int / array | No | auto | One or multiple viewer user IDs, comma-separated or array. Only users from the same project are applied. |
personal_ids |
int / array | No | – | One or multiple user IDs for personal mention notifications, comma-separated or array. Only users from the same project are applied. |
* Either session_id or token is required.
** Either task_id or track_id is required.
*** comment is required unless has_files is provided.
{
"data": {
"operation_status": "SUCCESS",
"comment_id": 501
}
}
{
"data": {
"operation_status": "FAILED",
"operation_message": "task_id OR track_id is required"
},
"error_message": "task_id OR track_id is required",
"error_no": 2003
}
The method creates a record in the comments table.
| Field | Type | Description |
|---|---|---|
comment_id |
int | Unique comment identifier. Returned in the response. |
user_id |
int | ID of the user who created the comment. Taken from the current session/token. |
project_id |
int | Project ID resolved from the selected task or board. |
track_id |
int | Board ID linked to the comment. Can be null for task-only context if not provided directly. |
task_id |
int | Task ID linked to the comment. Can be null for board comments. |
created |
datetime | Date and time when the comment was created. |
updated |
datetime | Date and time when the comment was created or last updated. |
edited |
datetime | Date and time when the comment was created or edited. |
comment |
mediumtext | Full formatted comment content. |
comment_text |
string | Plain-text version of the comment, up to 512 characters. Blockquotes are excluded from this text version. |
comment_history |
array/json | Initial value is an empty JSON array []. |
status |
enum | Comment status: ACTIVE, REMOVED. |
label_id |
int/null | Linked label ID if a valid label was provided. |
meta |
text | Additional metadata passed in the request. |
After successful comment creation, the method can perform additional actions:
doboard.com/{account_id}/task/{task_id} from the comment and creates related task links.personal_ids.COMMENTED.account:{account_id}.| HTTP Code | error_no |
Message | Description |
|---|---|---|---|
401 |
– | Unauthorized |
Missing or invalid session/token. |
200 |
2001 |
Track Not Found |
track_id was provided, but the board does not exist. |
200 |
2002 |
Task Not Found |
task_id was provided, but the task does not exist. |
200 |
2003 |
task_id OR track_id is required |
Neither task_id nor track_id was provided. |
200 |
2004 |
Access denied |
User has no access to the selected track. |
200 |
2005 |
Access denied |
User has no access to the selected task/project or guest token context is invalid. |
200 |
2006 |
status must be in ('ACTIVE','REMOVED') |
Invalid status value. |
200 |
2007 |
comment is required |
comment is empty and has_files is not provided. |
200 |
0 |
Internal API Error |
Internal error or database insert failure. |
task_id and track_id are provided, both are processed, but project context is resolved based on the later loaded entity.comment_text is generated automatically from the formatted HTML comment.viewers_ids and personal_ids can be sent as arrays or comma-separated strings.viewers_ids is not provided, default viewers are resolved from user/project settings.personal_ids users are also added to viewers if they are valid project users.label_id is saved only if the label exists.has_files is provided.operation_status and comment_id; full comment data can be retrieved via comment_get.