# Update A Comment

PATCH https://services.leadconnectorhq.com/projects/tasks/{taskId}/comments/{commentId}

Updates TipTap `body` and, when sent, `mentionedUserIds` — see [TipTap documentation](https://tiptap.dev/docs/editor/introduction). **403** unless the caller is the comment author. Response: `{ "comment": { … } }`.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `projects/tasks.comments.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `taskId` | string | Yes | Task id |
| `commentId` | string | Yes | Comment id |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | No | Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-04-15"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/projects/tasks/{taskId}/comments/{commentId}": {
      "patch": {
        "summary": "Update A Comment",
        "operationId": "updateAComment",
        "description": "Updates TipTap `body` and, when sent, `mentionedUserIds` — see [TipTap documentation](https://tiptap.dev/docs/editor/introduction). **403** unless the caller is the comment author. Response: `{ \"comment\": { … } }`.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-04-15"
              ]
            }
          },
          {
            "name": "taskId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string",
              "example": "6a102435124ecfb348bd5509",
              "description": "Task id"
            },
            "description": "Task id"
          },
          {
            "name": "commentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string",
              "example": "6a102435124ecfb348bd5510",
              "description": "Comment id"
            },
            "description": "Comment id"
          },
          {
            "name": "locationId",
            "required": false,
            "in": "query",
            "description": "Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers.",
            "schema": {
              "example": "ve9EPM428h8b87FE9C12Kg",
              "type": "string",
              "description": "Location id. Required for APP channel (`?locationId=`). Ignored for OAuth/PIT (token location is used). Do not send in path, body, or headers."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCommentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsCommentResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — missing scope or no access to this space, folder, list, or task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found — space, folder, list, task, comment, or recurring task missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "projects/tasks.comments.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "UpdateCommentDto": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "description": "Updated TipTap comment body (HTML or JSON). See [TipTap documentation](https://tiptap.dev/docs/editor/introduction).",
            "maxLength": 32000,
            "example": "Looks good — shipping next."
          },
          "mentionedUserIds": {
            "description": "Updated mentioned user IDs",
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "user_2"
            ]
          }
        },
        "required": [
          "body"
        ],
        "title": "UpdateCommentDto"
      },
      "ProjectsCommentResponseDto": {
        "type": "object",
        "description": "Single comment create/update response",
        "required": [
          "comment"
        ],
        "properties": {
          "comment": {
            "description": "Comment",
            "allOf": [
              {
                "type": "object",
                "description": "Task comment. Text is TipTap `body` — see [TipTap documentation](https://tiptap.dev/docs/editor/introduction). Deleted comments are omitted from listings.",
                "required": [
                  "id",
                  "taskId",
                  "body",
                  "authorId"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Comment id",
                    "example": "6a102435124ecfb348bd5510"
                  },
                  "taskId": {
                    "type": "string",
                    "description": "Task id",
                    "example": "6a102435124ecfb348bd5509"
                  },
                  "body": {
                    "type": "string",
                    "description": "Comment text (`body` field). TipTap HTML or JSON, sanitised on write. See [TipTap documentation](https://tiptap.dev/docs/editor/introduction).",
                    "example": "Looks good — shipping next."
                  },
                  "authorId": {
                    "type": "string",
                    "description": "Author user id",
                    "example": "user_1"
                  },
                  "parentCommentId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Parent comment id for one-level replies; omit or `null` for top-level comments",
                    "example": "6a102435124ecfb348bd5510"
                  },
                  "mentionedUserIds": {
                    "type": "array",
                    "description": "Mentioned user ids",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "user_2"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "description": "Created at (ISO-8601)",
                    "example": "2026-09-20T17:00:00.000Z"
                  },
                  "updatedAt": {
                    "type": "string",
                    "description": "Updated at (ISO-8601)",
                    "example": "2026-09-20T17:00:00.000Z"
                  }
                },
                "title": "ProjectsCommentDto"
              }
            ],
            "example": null
          }
        },
        "title": "ProjectsCommentResponseDto"
      },
      "ProjectsErrorResponseDto": {
        "type": "object",
        "description": "Error payload for non-2xx responses. Same shape on every Projects operation.\n\n`message` is a string, or a string array for validation failures.\n\n`error` is usually the HTTP reason phrase (`Bad Request`, `Unprocessable Entity`, …). Known domain values include `graph_scope_invalid` (Search list-scope failures).\n\nWhen `error` is `graph_scope_invalid`, `reason` discriminates the failure: `too_many_ids` | `non_list_type` | `duplicate_graph_scope`.",
        "required": [
          "statusCode",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 422
          },
          "message": {
            "description": "Human-readable message, or a list of validation messages",
            "oneOf": [
              {
                "type": "string",
                "example": "Task is already in the destination list"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "dueDate must be a string"
                ]
              }
            ],
            "example": null
          },
          "error": {
            "type": "string",
            "description": "HTTP reason phrase or domain code when present. Domain codes seen today: `graph_scope_invalid`. Otherwise Nest’s reason phrase.",
            "example": "graph_scope_invalid"
          },
          "reason": {
            "type": "string",
            "description": "Present when `error` is `graph_scope_invalid`. Discriminates Search list-scope failures. Allowed: `too_many_ids`, `non_list_type`, `duplicate_graph_scope`.",
            "enum": [
              "too_many_ids",
              "non_list_type",
              "duplicate_graph_scope"
            ],
            "example": "too_many_ids"
          }
        },
        "example": {
          "statusCode": 422,
          "message": "graph.id scope may not exceed 10 list IDs",
          "error": "graph_scope_invalid",
          "reason": "too_many_ids"
        },
        "title": "ProjectsErrorResponseDto"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X PATCH 'https://services.leadconnectorhq.com/projects/tasks/<taskId>/comments/<commentId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-04-15' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "body": "Looks good — shipping next.",
  "mentionedUserIds": [
    "user_2"
  ]
}'
```

**Node.js**

```javascript
const options = {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-04-15',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "body": "Looks good — shipping next.",
      "mentionedUserIds": [
        "user_2"
      ]
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/projects/tasks/<taskId>/comments/<commentId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/projects/tasks/{taskId}/comments/{commentId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-04-15"
}

payload = {
    "body": "Looks good — shipping next.",
    "mentionedUserIds": [
        "user_2"
    ]
}

response = requests.patch(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/projects/tasks/<taskId>/comments/<commentId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-04-15',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "body": "Looks good — shipping next.",
  "mentionedUserIds": [
    "user_2"
  ]
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .patch("https://services.leadconnectorhq.com/projects/tasks/<taskId>/comments/<commentId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-04-15")
  .header("Content-Type", "application/json")
  .body("{\"body\":\"Looks good — shipping next.\",\"mentionedUserIds\":[\"user_2\"]}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/projects/tasks/<taskId>/comments/<commentId>"
  payload := strings.NewReader(`{
  "body": "Looks good — shipping next.",
  "mentionedUserIds": [
    "user_2"
  ]
}`)
  req, _ := http.NewRequest("PATCH", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-04-15")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/projects/tasks/<taskId>/comments/<commentId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-04-15"
request["Content-Type"] = "application/json"
request.body = '{
  "body": "Looks good — shipping next.",
  "mentionedUserIds": [
    "user_2"
  ]
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-04-15"
}

$body = '{
  "body": "Looks good — shipping next.",
  "mentionedUserIds": [
    "user_2"
  ]
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/projects/tasks/<taskId>/comments/<commentId>' -Method 'PATCH' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
