latestOpenAPI 3.1.02026-08-211061591.1 MB

69a962f1578f

Comments

Create Comment

Creates a new comment on a project or task and returns it.

Exactly one of task_id or project_id arguments is required. Providing neither or both will return an error.

post/api/v1/comments

Request body

contentstring required

Content of the comment

project_idstring nullable

String ID of the project

task_idstring nullable

String ID of the task

attachmentobject nullable

A File attachment object

uids_to_notifyinteger[] nullable

Optional list of user IDs to notify about this comment.

Example request

{
  "content": "Need one bottle of milk",
  "project_id": "6XGgm6PHrGgMpCFX",
  "task_id": "6XGgmFVcrG5RRjVr",
  "attachment": {
    "file_name": "File.pdf",
    "file_type": "application/pdf",
    "file_url": "https://s3.amazonaws.com/domorebetter/Todoist+Setup+Guide.pdf",
    "resource_type": "file"
  },
  "uids_to_notify": [
    12345678,
    23456789
  ]
}

Response

Successful Response

idstring required

String ID of the comment.

posted_uidstring nullable required

String ID of the user who posted the comment.

contentstring

Comment content.

file_attachmentobject nullable required

File attachment metadata, or null when the comment has no attachment.

uids_to_notifystring[] nullable required

String IDs of users notified by the comment.

is_deletedboolean required

Whether the comment is deleted.

posted_atstring date-time nullable required

Date and time when the comment was posted, or null if unknown.

reactionsobject nullable required

Reaction emoji mapped to user IDs that reacted.

Example response

{
  "id": "6XGgmFQrx44wfGHr",
  "posted_uid": "1234567",
  "content": "Looks good to me.",
  "uids_to_notify": [
    "1234567"
  ],
  "posted_at": "2025-01-15T10:30:00Z",
  "reactions": {
    "👍": [
      "1234567"
    ]
  }
}