# Update Comment Automation

### Update Comment Automation

Update an existing comment automation bot.

Use this endpoint when you want to modify an automation’s name, target rules, trigger behavior, reply method, timing, frequency, or AI response settings.

This is useful when you need to adjust how an existing comment bot responds to new comments without creating a new automation from scratch.

***

### Method

`PUT`

### URL

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

### Permission

`update-comment-automation`

***

### Headers

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

***

### Request Parameters

| Field            | Type            |    Required | Default     | Description                                                                 |
| ---------------- | --------------- | ----------: | ----------- | --------------------------------------------------------------------------- |
| comment\_bot\_id | integer         |         Yes | —           | ID of the comment automation bot to update                                  |
| name             | string          |          No | —           | Updated name of the comment automation bot                                  |
| 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 the bot should reply. 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 controls the style and behavior of AI-generated replies 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 level. Options: `none`, `minimal`, `moderate`, `abundant`                                    |

***

### Example Request Body

```json
{
  "comment_bot_id": 162,
  "name": "Update Comment Automation",
  "target_type": "posts",
  "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": "yes",
  "ai_settings": {
    "response_tone": "friendly",
    "response_length": "very_short",
    "ai_personality": "assistant",
    "creativity_level": "conservative",
    "language_style": "conversational",
    "emoji_usage": "none"
  }
}
```

***

### Example Response

```json
{
  "message": "Comment bot updated successfully",
  "comment_bot": {
    "id": 162,
    "name": "Update 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",
    "updated_at": "April 30, 2026 1:52 PM",
    "created_at": "April 30, 2026 1:52 PM",
    "ai_enable": "yes"
  },
  "status": true
}
```

***

### cURL

```bash
curl --location --request PUT 'https://app.marketingblocks.ai/api/v1/social-sparks/update-comment-automation' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "comment_bot_id": 162,
    "name": "Update Comment Automation",
    "target_type": "posts",
    "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": "yes",
    "ai_settings": {
      "response_tone": "friendly",
      "response_length": "very_short",
      "ai_personality": "assistant",
      "creativity_level": "conservative",
      "language_style": "conversational",
      "emoji_usage": "none"
    }
  }'
```

***

### Notes

* Always send the request body as raw JSON.
* `comment_bot_id` is required to identify the automation being updated.
* Use `target_type` to control where the automation applies.
* 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 the `ai_settings` object.
* If `ai_enable` is `no`, the bot uses the provided `comment_reply` and/or `direct_message`.
* The request token must include the `update-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/update-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.
