---
title: "Create comment"
method: POST
path: "/{sub_domain}/api/comments"
tags: ["Comments"]
---

# Create comment

`POST /{sub_domain}/api/comments`

## Request

- Base URL: `https://api.commpeak.com/dialer`
- URL: `https://api.commpeak.com/dialer/{sub_domain}/api/comments`
- Auth: API key in header `Authorization`

Add a comment to a campaign lead.

**Parameters.** Send the following in the request body. All three are required:

- `creator_user_id` (string): The ID of the user creating the comment. This user must already exist.
- `campaign_lead_id` (string): The ID of the campaign lead the comment belongs to. This campaign lead must already exist.
- `body` (string): The comment text. It cannot be empty.

**Returns.** `{ "comments": [ { ... } ] }` containing the created comment with its `id`, `created_at` timestamp, and `success` set to `true`.

**Example.**

```json
{
  "creator_user_id": "100",
  "campaign_lead_id": "1234",
  "body": "this is your comment content"
}
```

## Path parameters

- `sub_domain` string, required: Dialer Name (subdomain)

## Request body

- CreateCommentInput
  - `creator_user_id` string, required: ID of the user creating the comment.
  - `campaign_lead_id` string, required: ID of the campaign lead the comment relates to.
  - `body` string, required: The comment's text.

## Response `201`

Successful Response

- CommentsResponse
  - `comments` CommentItem[], required
    - `id` integer, nullable: Comment ID (present only for successfully created items).
    - `campaign_lead_id` integer, nullable: Campaign lead ID the comment belongs to.
    - `creator_user_id` integer, nullable: ID of the user who created the comment.
    - `lead_id` integer, nullable: Lead ID.
    - `body` string, nullable: The comment's text.
    - `created_at` string, nullable: Timestamp the comment was created (present only for successfully created items).
    - `username` string, nullable: Username of the comment's creator.
    - `original_identifier` string, nullable: Lead original identifier.
    - `success` boolean, nullable: true when the comment was created; otherwise a string describing why it failed.
  - `total_comments` integer, nullable: Total number of comments in the response.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/commpeak/apis/commpeak-dialer-api.md) - [All operations](https://skmtc.dev/commpeak/apis/commpeak-dialer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/commpeak/apis/commpeak-dialer-api/revisions/18c5edc07544?raw)
