# Create Comment Automation

### Create Comment Automation

Create a comment automation bot that automatically replies to comments made on posts published through the Social Growth Engine.

This endpoint allows you to define where the automation runs, what triggers it, how it responds, and whether replies should be manually defined or generated using AI.

***

### Method

`POST`

### URL

```
https://app.marketingblocks.ai/api/v1/social-sparks/create-comment-automation
```

### Permission

`create-comment-automation`

***

### Headers

```
Authorization: Bearer <token>
Content-Type: application/json
```

***

### Request Parameters

| Field           | Type            |    Required | Default     | Description                                                                 |
| --------------- | --------------- | ----------: | ----------- | --------------------------------------------------------------------------- |
| name            | string          |         Yes | —           | Name of the comment automation bot                                          |
| channels        | array\[integer] |         Yes | —           | IDs of connected social channels where the automation will run              |
| target\_type    | string          |          No | `all`       | Scope of automation. Options: `all`, `posts`, `campaigns`                   |
| post\_ids       | array\[integer] | Conditional | —           | Required if `target_type = posts`. IDs of published posts                   |
| campaign\_ids   | array\[integer] | Conditional | —           | Required if `target_type = campaigns`. IDs of campaigns                     |
| trigger\_type   | string          |          No | `any`       | Trigger logic. Options: `any`, `keywords`                                   |
| keywords        | array\[string]  | Conditional | —           | Required if `trigger_type = keywords`. Keywords that trigger the automation |
| response\_type  | string          |          No | `both`      | Response type. Options: `comment`, `direct_message`, `both`                 |
| comment\_reply  | string          |          No | —           | Message sent as a public comment reply                                      |
| direct\_message | string          |          No | —           | Message sent as a private direct message                                    |
| response\_time  | string          |          No | `instant`   | When the response is sent. Options: `instant`, `delayed`                    |
| delay\_time     | integer         | Conditional | `0`         | Required if `response_time = delayed`. Delay in seconds                     |
| frequency       | string          |          No | `everytime` | How often to respond. Options: `everytime`, `once`, `randomly`              |
| ai\_enable      | string          |          No | `yes`       | Enable AI-generated responses. Options: `yes`, `no`                         |
| ai\_settings    | object          | Conditional | —           | Required if `ai_enable = yes`. Defines AI response behavior                 |

***

### AI Settings Object

The `ai_settings` object allows you to control how AI-generated replies should sound when `ai_enable` is set to `yes`.

| Field             | Type   | Description                                                                                              |
| ----------------- | ------ | -------------------------------------------------------------------------------------------------------- |
| response\_tone    | string | Tone of response. Options: `friendly`, `professional`, `casual`, `helpful`, `empathetic`, `enthusiastic` |
| response\_length  | string | Length of response. Options: `very short`, `short`, `medium`, `long`                                     |
| ai\_personality   | string | AI persona. Options: `assistant`, `expert`, `friend`, `educator`, `customer support`, `promoter`         |
| creativity\_level | string | Creativity level. Options: `conservative`, `balanced`, `creative`, `highly creative`                     |
| language\_style   | string | Writing style. Options: `conversational`, `formal`, `technical`, `simple`                                |
| emoji\_usage      | string | Emoji usage. Options: `none`, `minimal`, `moderate`, `abundant`                                          |

***

### Example Request Body

```json
{
  "name": "New Comment Automation",
  "channels": [4125, 4500],
  "target_type": "posts",
  "post_ids": [121816, 121691, 121653],
  "trigger_type": "any",
  "response_type": "both",
  "response_time": "instant",
  "frequency": "everytime",
  "comment_reply": "Thanks for the comment",
  "direct_message": "Thank you a comment on my post",
  "ai_enable": "no"
}
```

***

### Example Request With AI Enabled

```json
{
  "name": "AI Comment Automation",
  "channels": [4125, 4500],
  "target_type": "posts",
  "post_ids": [121816, 121691, 121653],
  "trigger_type": "keywords",
  "keywords": ["pricing", "demo", "interested"],
  "response_type": "both",
  "response_time": "delayed",
  "delay_time": 60,
  "frequency": "everytime",
  "comment_reply": "Thanks for your comment!",
  "direct_message": "Thanks for commenting. We’ll be happy to share more details with you.",
  "ai_enable": "yes",
  "ai_settings": {
    "response_tone": "friendly",
    "response_length": "short",
    "ai_personality": "assistant",
    "creativity_level": "balanced",
    "language_style": "conversational",
    "emoji_usage": "minimal"
  }
}
```

***

### Example Response

```json
{
  "message": "Comment bot created successfully",
  "comment_bot": {
    "name": "New Comment Automation",
    "trigger_type": "any",
    "response": {
      "comment_responses": [
        "Thanks for the comment"
      ],
      "dm_responses": "Thank you a comment on my post"
    },
    "response_type": "both",
    "response_time": "instant",
    "delay_time": 0,
    "reply_frequency": "everytime",
    "status": "active",
    "channels": [
      4125,
      4500
    ],
    "updated_at": "April 30, 2026 1:52 PM",
    "created_at": "April 30, 2026 1:52 PM",
    "id": 162,
    "ai_enable": "no"
  },
  "status": true
}
```

***

### cURL

```bash
curl --location 'https://app.marketingblocks.ai/api/v1/social-sparks/create-comment-automation' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "New Comment Automation",
    "channels": [4125, 4500],
    "target_type": "posts",
    "post_ids": [121816, 121691, 121653],
    "trigger_type": "any",
    "response_type": "both",
    "response_time": "instant",
    "frequency": "everytime",
    "comment_reply": "Thanks for the comment",
    "direct_message": "Thank you a comment on my post",
    "ai_enable": "no"
  }'
```

***

### Notes

* Always send the request body as raw JSON.
* Use valid connected channel IDs in the `channels` array.
* If `target_type` is `posts`, include `post_ids`.
* If `target_type` is `campaigns`, include `campaign_ids`.
* If `trigger_type` is `keywords`, include `keywords`.
* If `response_time` is `delayed`, include `delay_time`.
* If `ai_enable` is `yes`, include `ai_settings`.
* The request token must include the `create-comment-automation` permission.
* If the token is missing, expired, or does not include the required permission, the API returns `401 Unauthorized`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.marketingblocks.ai/agentic-ai-docs/api-reference/social-growth-engine/comment-automation/create-comment-automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
