How to Create Task Comments with the ClickUp API
The ClickUp developer platform lets you programmatically add comments to tasks so your apps can collaborate directly inside ClickUp. This guide explains how to call the Create Task Comment endpoint, what parameters you must send, and how to handle responses safely.
Understanding the ClickUp task comment endpoint
The Create Task Comment endpoint allows your integration to post a new comment on a specific task. You can send plain text, rich HTML content, or include file attachments, all linked to a single task in your workspace.
This endpoint is ideal for:
- Logging automated updates directly into task discussions
- Syncing comments from external tools into task threads
- Adding system notifications visible to your team in the task activity feed
The official reference for this endpoint is available on the ClickUp Create Task Comment API page.
Prerequisites for using the ClickUp API
Before you can create a task comment through the ClickUp API, make sure you have the following in place:
- An active ClickUp workspace with at least one task created
- A valid API token with permission to access the target task
- The ID of the task where you want to post a comment
- A tool to send HTTP requests, such as cURL, Postman, or a backend service
Your API token must be sent in the request header so the ClickUp platform can authenticate the call and associate the comment with the correct user or integration.
ClickUp endpoint URL and HTTP method
The endpoint to create a comment on a task uses the HTTP POST method. You must include the task ID in the URL path. The general structure is:
POST https://api.clickup.com/api/v2/task/{task_id}/comment
Replace {task_id} with the actual task ID from your ClickUp workspace. The same pattern applies regardless of whether the task is in a list, folder, or space, as long as your API token has the correct access.
Required headers for ClickUp requests
Every request to this endpoint must include specific headers so the ClickUp server can validate and parse your data. At minimum, you must send:
Authorization: your ClickUp API tokenContent-Type: usuallyapplication/jsonfor JSON payloads, ormultipart/form-datawhen uploading files
A typical header configuration looks like this:
Authorization: <your_clickup_token>
Content-Type: application/json
Never expose your ClickUp token in client-side code or public repositories. Always store it securely in environment variables or a secrets manager.
ClickUp request body parameters
The request body defines what the comment will contain and how it behaves in the task. The Create Task Comment endpoint supports several fields, some required and some optional.
Core fields for creating a ClickUp comment
The main parameters include:
- comment_text: The content of the comment. This is required when you are not sending attachments only. It can contain plain text or supported HTML markup.
- assignee: Optional user ID to assign the comment to someone. When used, ClickUp can notify that user depending on their notification settings.
- notify_all: Optional boolean to trigger notifications to watchers of the task when set to
true.
Your body must at least define the comment text or valid attachment data so the ClickUp API can create a visible entry in the task thread.
Sending rich text with HTML in ClickUp
The endpoint supports HTML-based content for rich formatting. When using HTML:
- Wrap the full comment in a string, such as
"<p>Update:</p><ul><li>Item 1</li></ul>" - Escape special characters in JSON, for example, quotes and line breaks
- Stay within the HTML elements documented in the official ClickUp reference to ensure rendering is consistent in the task view
This approach lets your integration mirror nicely formatted status messages inside ClickUp tasks.
Adding attachments to ClickUp task comments
You can attach files to a comment by sending a multipart request. In that case:
- Set
Content-Typetomultipart/form-data - Include the file parts as specified in the ClickUp documentation
- Combine attachments with text if you want a message plus one or more files in a single comment
Each uploaded file becomes part of the comment thread, visible in the ClickUp task interface.
Step-by-step: create a ClickUp task comment
Use the following workflow to safely create a new comment via the API:
- Collect the task ID
Obtain the ID from an existing task. You can get it from a previous API call or from the task URL in the ClickUp app.
- Prepare your API token
Copy your personal or app-level token and store it in a secure environment variable.
- Build the endpoint URL
Insert the task ID into the endpoint path, for example:
https://api.clickup.com/api/v2/task/abc123/comment. - Set up request headers
Add your
Authorizationheader with the token and setContent-Typeaccording to your payload type. - Create the JSON body
Include at least
comment_text. Optionally defineassigneeandnotify_allfor advanced behavior. - Send the POST request
Use your preferred HTTP client or backend service to send the request to the ClickUp API endpoint.
- Review the response
Check the returned JSON for the new comment ID, timestamps, and any error messages. Handle failures gracefully and log details for debugging.
Handling ClickUp responses and errors
When the request is successful, the ClickUp API responds with a JSON object describing the new comment. Common fields include:
- The unique comment ID
- The user who created the comment
- The comment text that was saved
- Timestamps for creation
If the request fails, you may see status codes such as:
- 400: Invalid body or missing required parameters
- 401: Authentication issue with the ClickUp token
- 404: Task ID not found or not accessible with your token
Use these codes and any error messages from the ClickUp API to adjust your payload, verify permissions, or correct the target task.
Best practices for integrating with ClickUp
To keep your integration reliable and user friendly, follow these recommendations:
- Validate task IDs and user IDs before sending the request
- Limit comment frequency to avoid unnecessary noise in ClickUp threads
- Sanitize and escape all user input before embedding it in HTML comment bodies
- Log both request and response data (excluding secrets) for troubleshooting
For teams building complex workflows around the ClickUp ecosystem, partnering with experienced consultants can accelerate development. You can explore additional automation and integration services at Consultevo.
Next steps for your ClickUp integration
By using the Create Task Comment endpoint, your application can post updates directly into task conversations, attach files, and notify the right people without leaving ClickUp. Combine this endpoint with task creation and update endpoints to build complete workflows that keep all activity centralized.
Review the full parameter list, supported HTML formatting, and advanced options on the official ClickUp API reference for creating task comments, then extend your implementation with additional endpoints to cover your entire lifecycle.
Need Help With ClickUp?
If you want expert help building, automating, or scaling your ClickUp workspace, work with ConsultEvo — trusted ClickUp Solution Partners.
“`
