---
title: "Add a comment to a task"
method: POST
path: "/cohorts/{cohortId}/tasks/{id}/comments"
tags: ["Tasks"]
---

# Add a comment to a task

`POST /cohorts/{cohortId}/tasks/{id}/comments`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/cohorts/{cohortId}/tasks/{id}/comments`
- Auth: HTTP bearer

Add a new comment to a task

## Path parameters

- `cohortId` string, uuid, required
- `id` string, uuid, required

## Request body

- object
  - `content` string, required: Comment content

## Response `201`

Comment added successfully

- object
  - `success` boolean
  - `data` TaskComment
    - `id` string, uuid
    - `task_id` string, uuid
    - `author_id` string, uuid
    - `content` string
    - `author_name` string
    - `author_email` string
    - `author_avatar_url` string, nullable
    - `created_at` string, date-time

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `404`: Task or cohort not found

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
