# Create a new comment for a task

**Required scopes:** `task-management:write`

Endpoint: POST /tasks/comments
Version: v1
Security: http, oauth2

## Security:

  - `http` (unknown)
    http bearer

  - `oauth2` (unknown)
    oauth2

## Request fields (application/json):

  - `external_id` (string | null)
    Can be used to add an identifier from an external system, must be unique within integration (integration's slug)

  - `external_origin` (string)
    If not set, integration's slug will be used as default

  - `task_id` (string, required)

  - `parent_comment_id` (string | null)

  - `comment` (string)
    In HTML
use `<mention data-id="<UserID>" />` to mention user

  - `is_public` (boolean)

## Response 200:

  - `200` (unknown)
    `CommentData`

## Response 200 fields (application/json):

  - `id` (string, required)

  - `external_id` (string | null, required)

  - `external_origin` (string | null, required)
    If originated from external system origin is added

  - `parent_comment_id` (string | null, required)

  - `parent_comment` (any)

  - `task` (any)

  - `task.id` (string, required)

  - `task.project_id` (string, required)

  - `task.client_id` (string, required)

  - `task.parent_task_id` (string, required)

  - `task.external_id` (string | null, required)

  - `task.external_origin` (string | null, required)
    If originated from external system origin is added

  - `task.uri` (string, required)

  - `task.title` (string, required)

  - `task.description` (string | null, required)

  - `task.status` (string, required)
    |  |
|  --- |
| `Backlog`  |
| `New`  In Todo |
| `WIP`  In progress |
| `Completed`  |
| `Approved`  |
| `Closed`  Task was archived |
    Enum: "Backlog", "New", "WIP", "Completed", "Approved", "Closed"

  - `task.type` (string, required)

  - `task.estimated_hours` (number | null, required)

  - `task.is_onhold` (boolean, required)

  - `task.is_public` (boolean, required)
    If false, the task is only visible to the project team - not guest users

  - `task.due_date` (string | null, required)

  - `task.due_date_settings` (object, required)

  - `task.due_date_settings.is_hard_deadline` (boolean, required)

  - `task.due_date_settings.recurring_type` (any, required)

  - `task.due_date_settings.recurring_interval` (integer | null, required)
    Integer offset
if `recurring_type` = `daily` or `NULL` -> offset ignored 
if `recurring_type` = `weekly` -> 1 = every Monday, 2 = every Tuesday, etc 
if `recurring_type` = `monthly` -> 1 = every month, 2 = every 2 months, etc

  - `task.assignee` (any, required)

  - `task.assignee.id` (string, required)

  - `task.assignee.first_name` (string, required)

  - `task.assignee.last_name` (string, required)

  - `task.assignee.email` (string, required)

  - `task.assignee.type` (string, required)
    Enum: "user", "guest", "tax_advisor", "integration"

  - `task.assignee.space` (object, required)

  - `task.assignee.space.id` (string, required)

  - `task.assignee.space.name` (string, required)

  - `task.priorityOption` (any, required)

  - `task.priorityOption.id` (string, required)

  - `task.priorityOption.label` (string, required)

  - `task.phase` (any)

  - `task.phase.id` (string, required)

  - `task.phase.title` (string, required)

  - `task.phase.po_number` (string | null, required)

  - `task.phase.group` (any, required)

  - `task.phase.group.id` (string, required)

  - `task.phase.group.title` (string, required)

  - `task.phase.group.sort_order` (integer | null, required)
    Manual sort position among top-level phases/milestones/groups.
Null when the project uses the default (date-based) ordering

  - `task.phase.type` (any, required)

  - `task.phase.type.id` (string, required)

  - `task.phase.type.title` (string, required)

  - `task.phase.type.color` (string, required)

  - `task.phase.dependency_phase_id` (string | null, required)

  - `task.phase.dependency_milestone_id` (string | null, required)

  - `task.phase.start_date` (string | null, required)

  - `task.phase.end_date` (string | null, required)

  - `task.phase.created_at` (string | null, required)

  - `task.phase.estimated_hours` (number, required)

  - `task.phase.sort_order` (integer | null, required)
    Manual sort position within its scope (group children, or top level).
Null when the project uses the default (date-based) ordering

  - `task.phase.custom_fields` (object)
    Custom field values keyed by field name/slug; the value type depends on the field type
(number: float, checkbox: bool, multi-select: JSON encoded string array, others: string).
Only filled for users of the space that owns the project, `{}` for guests and other spaces.
Returned by the project phases endpoint only

  - `task.phase.computed_fields` (object)

  - `task.milestone` (any)

  - `task.milestone.id` (string, required)

  - `task.milestone.title` (string, required)

  - `task.milestone.po_number` (string | null, required)

  - `task.milestone.group` (any, required)

  - `task.milestone.dependency_phase_id` (string | null, required)

  - `task.milestone.dependency_milestone_id` (string | null, required)

  - `task.milestone.date` (string, required)

  - `task.milestone.created_at` (string | null, required)

  - `task.milestone.estimated_hours` (number, required)

  - `task.milestone.sort_order` (integer | null, required)
    Manual sort position within its scope (group children, or top level).
Null when the project uses the default (date-based) ordering

  - `task.milestone.custom_fields` (object)
    Custom field values keyed by field name/slug; the value type depends on the field type
(number: float, checkbox: bool, multi-select: JSON encoded string array, others: string).
Only filled for users of the space that owns the project, `{}` for guests and other spaces.
Returned by the project milestones endpoint only

  - `task.milestone.computed_fields` (object)

  - `task.epic` (any)

  - `task.epic.id` (string, required)

  - `task.epic.title` (string, required)

  - `task.epic.po_number` (string | null, required)

  - `task.epic.estimated_hours` (number, required)

  - `task.epic.computed_fields` (object)

  - `task.parent_task` (any)

  - `task.attachements` (array, required)

  - `task.attachements.id` (string, required)

  - `task.attachements.file_name` (string, required)

  - `task.attachements.mime_type` (string, required)

  - `task.attachements.size` (integer, required)
    File size in bytes

  - `task.attachements.entity_id` (string, required)
    ID of the entity that the file belongs to

  - `task.attachements.entity_type` (string, required)
    Type of the entity that the file belongs to

  - `task.attachements.created_at` (string, required)

  - `task.watchers` (array)

  - `task.sub_tasks` (array, required)

  - `task.completed_at` (string | null, required)

  - `task.closed_at` (string | null, required)

  - `task.updated_at` (string | null, required)

  - `task.created_at` (string | null, required)

  - `task.list_sorting` (integer, required)

  - `task.custom_fields` (object, required)
    Custom field values keyed by field name/slug

  - `sub_comments` (array, required)

  - `comment` (string | null, required)

  - `attachements` (array, required)

  - `is_public` (boolean, required)
    If false, the task is only visible to the project team - not guest users

  - `created_at` (string | null, required)

  - `updated_at` (string | null, required)

## Response 401:

  - `401` (unknown)
    Unauthenticated

## Response 401 fields (application/json):

  - `message` (string, required)
    Error overview.

## Response 422:

  - `422` (unknown)
    Validation error

## Response 422 fields (application/json):

  - `message` (string, required)
    Errors overview.

  - `errors` (object, required)
    A detailed description of each field that failed validation.

