Update Comment Automation API
The Update Comment Automation API updates an existing comment automation by its id. Send a PATCH request to /v1/comment-automations/{id} with the x-access-key header and a JSON body using the optional fields in the field map. The response returns the updated automation, including its trigger, actions and stats, or an error response for a 400, 403 or 404 status.
Update Comment Automation API with PATCH {{API_BASE_URL}}/v1/comment-automations/{id}
Use PATCH with the path /v1/comment-automations/{id} to update an existing comment automation. Replace {id} with the required string identifier of the automation to update. Send the request with Content-Type application/json and the x-access-key header set to <token>. The worked PATCH example below shows a contract-valid request using only values allowed by the source enums and constraints.
Authorization: x-access-key header with <token>
Authorization uses the x-access-key header. Provide the token as the header value, as shown in the worked PATCH example. The contract defines a 403 application/json response with the success and message shape described in the failure matrix; the source does not state its cause.
Path parameter id and optional request body field map
The path parameter id is a required string and identifies the comment automation to update. The request body is application/json and every field in it is optional in the source contract; omitted-field behavior is not described in the source. Check each value against the field map before sending the request. In particular, verify that name is between 1 and 100 characters when present, that keywords and excludeKeywords each contain no more than 20 items, that publicReplies contains no more than 5 items, and that dmMessage is between 1 and 1000 characters when present.
Worked PATCH example and 200 response automation object
On success, the endpoint returns 200 application/json with success set to true and an automation object. Read automation.id, automation.accountId, automation.platform, automation.name and automation.status to confirm which automation was updated and its current status. Then inspect automation.trigger for postScope, platformPostId, postPermalink, postId, keywords, matchMode and excludeKeywords, automation.actions for publicReplies and dmMessage, and automation.stats for triggered, succeeded, failed, lastRunAt and lastError. The automation object also includes createdAt and updatedAt as date-time strings. Use the returned values, rather than assuming the request values were applied unchanged, to confirm the stored state.
Error responses 400, 403 and 404 and source contract notes
The contract defines 400, 403 and 404 responses, each as application/json with success and message fields. The source does not state specific error messages, codes or causes for these statuses, so treat the status code as the primary signal and read message for the response text without assuming a cause. When checking a request, recheck the request body against the field map, including types, lengths, item limits and enum values, recheck the x-access-key header, and recheck that the id in the path matches the automation you intend to update.
| Field | Required | Type | Constraints or enum |
|---|---|---|---|
| name | Optional | string | 1 <= length <= 100 |
| status | Optional | string | "active" | "paused" |
| postScope | Optional | string | "any" | "specific" |
| platformPostId | Optional | string | 1 <= length |
| postPermalink | Optional | string | Format: uri |
| keywords | Optional | array<string> | items <= 20; each item 1 <= length <= 60 |
| matchMode | Optional | string | "exact" | "contains" | "word" |
| excludeKeywords | Optional | array<string> | items <= 20; each item 1 <= length <= 60 |
| publicReplies | Optional | array<string> | items <= 5; each item 1 <= length <= 500 |
| dmMessage | Optional | string | 1 <= length <= 1000 |
All request body fields are optional in the source contract. Omitted-field behavior is not described in the source.
| Status | Content type | Response fields | How to check it |
|---|---|---|---|
| 200 | application/json | success: boolean; automation: object with id, accountId, platform, name, status, trigger, actions, stats, createdAt, updatedAt | Confirm the returned automation values and nested trigger, actions and stats objects. |
| 400 | application/json | success: boolean; message: string | Recheck the request body against the field map, including types, lengths, item limits and enum values. |
| 403 | application/json | success: boolean; message: string | Recheck the x-access-key header and its <token> value. |
| 404 | application/json | success: boolean; message: string | Recheck that the id in /v1/comment-automations/{id} matches the automation you intend to update. |
Specific error messages, codes and causes are not supplied in the source contract and are not invented here.
curl -X PATCH "{{API_BASE_URL}}/v1/comment-automations/{id}" \
-H "Content-Type: application/json" \
-H "x-access-key: <token>" \
-d '{
"name": "Launch comments",
"status": "paused",
"postScope": "specific",
"platformPostId": "post_123",
"postPermalink": "https://example.com/posts/post_123",
"keywords": ["launch"],
"matchMode": "contains",
"excludeKeywords": ["spam"],
"publicReplies": ["Thanks for your comment."],
"dmMessage": "Thanks for your comment."
}'{
"success": true,
"automation": {
"id": "string",
"accountId": "string",
"platform": "string",
"name": "string",
"status": "active",
"trigger": {
"postScope": "any",
"platformPostId": "string",
"postPermalink": "string",
"postId": "string",
"keywords": [
"string"
],
"matchMode": "exact",
"excludeKeywords": [
"string"
]
},
"actions": {
"publicReplies": [
"string"
],
"dmMessage": "string"
},
"stats": {
"triggered": 0,
"succeeded": 0,
"failed": 0,
"lastRunAt": "2019-08-24T14:15:22Z",
"lastError": "string"
},
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
}{
"success": true,
"message": "string"
}| Scope | Field | Type | Type reference | Required | Description | Constraints |
|---|---|---|---|---|---|---|
| id#1 | id | string | __0 | Yes | ||
| body#2 | body | object | __0 | Yes | ||
| body#2 | body.name | string | __1 | No | kind: ; value: 1 <= length <= 100 | |
| body#2 | body.status | string | __2 | No | ||
| body#2 | body.status[variant1] | string | __2_extends:__3 | kind: ; value: "active" | ||
| body#2 | body.status[variant2] | string | __2_extends:__4 | kind: ; value: "paused" | ||
| body#2 | body.postScope | string | __5 | No | ||
| body#2 | body.postScope[variant1] | string | __5_extends:__6 | kind: ; value: "any" | ||
| body#2 | body.postScope[variant2] | string | __5_extends:__7 | kind: ; value: "specific" | ||
| body#2 | body.platformPostId | string | __8 | No | kind: ; value: 1 <= length | |
| body#2 | body.postPermalink | string | __9 | No | kind: ; value: uri | |
| body#2 | body.keywords | array<string> | __10 | No | kind: ; value: items <= 20 | |
| body#2 | body.keywords[] | string | __11 | kind: ; value: 1 <= length <= 60 | ||
| body#2 | body.matchMode | string | __12 | No | ||
| body#2 | body.matchMode[variant1] | string | __12_extends:__13 | kind: ; value: "exact" | ||
| body#2 | body.matchMode[variant2] | string | __12_extends:__14 | kind: ; value: "contains" | ||
| body#2 | body.matchMode[variant3] | string | __12_extends:__15 | kind: ; value: "word" | ||
| body#2 | body.excludeKeywords | array<string> | __16 | No | kind: ; value: items <= 20 | |
| body#2 | body.excludeKeywords[] | string | __17 | kind: ; value: 1 <= length <= 60 | ||
| body#2 | body.publicReplies | array<string> | __18 | No | kind: ; value: items <= 5 | |
| body#2 | body.publicReplies[] | string | __19 | kind: ; value: 1 <= length <= 500 | ||
| body#2 | body.dmMessage | string | __20 | No | kind: ; value: 1 <= length <= 1000 | |
| response#3 | response | object | __0 | |||
| response#3 | response.success | boolean | __1 | Yes | ||
| response#3 | response.automation | object | __2 | Yes | ||
| response#3 | response.automation.id | string | __3 | Yes | ||
| response#3 | response.automation.accountId | string | __4 | Yes | ||
| response#3 | response.automation.platform | string | __5 | Yes | ||
| response#3 | response.automation.name | string | __6 | Yes | ||
| response#3 | response.automation.status | string | __7 | Yes | ||
| response#3 | response.automation.status[variant1] | string | __7_extends:__8 | kind: schemaValueIn; value: "active" | ||
| response#3 | response.automation.status[variant2] | string | __7_extends:__9 | kind: schemaValueIn; value: "paused" | ||
| response#3 | response.automation.trigger | object | __10 | Yes | ||
| response#3 | response.automation.trigger.postScope | string | __11 | Yes | ||
| response#3 | response.automation.trigger.postScope[variant1] | string | __11_extends:__12 | kind: schemaValueIn; value: "any" | ||
| response#3 | response.automation.trigger.postScope[variant2] | string | __11_extends:__13 | kind: ; value: "specific" | ||
| response#3 | response.automation.trigger.platformPostId | string | null | __14 | Yes | ||
| response#3 | response.automation.trigger.platformPostId[variant1] | string | __14_extends:__15 | |||
| response#3 | response.automation.trigger.platformPostId[variant2] | null | __14_extends:__16 | |||
| response#3 | response.automation.trigger.postPermalink | string | null | __17 | Yes | ||
| response#3 | response.automation.trigger.postPermalink[variant1] | string | __17_extends:__18 | |||
| response#3 | response.automation.trigger.postPermalink[variant2] | null | __17_extends:__19 | |||
| response#3 | response.automation.trigger.postId | string | null | __20 | Yes | ||
| response#3 | response.automation.trigger.postId[variant1] | string | __20_extends:__21 | |||
| response#3 | response.automation.trigger.postId[variant2] | null | __20_extends:__22 | |||
| response#3 | response.automation.trigger.keywords | array<string> | __23 | Yes | ||
| response#3 | response.automation.trigger.keywords[] | string | __24 | |||
| response#3 | response.automation.trigger.matchMode | string | __25 | Yes | ||
| response#3 | response.automation.trigger.matchMode[variant1] | string | __25_extends:__26 | kind: ; value: "exact" | ||
| response#3 | response.automation.trigger.matchMode[variant2] | string | __25_extends:__27 | kind: ; value: "contains" | ||
| response#3 | response.automation.trigger.matchMode[variant3] | string | __25_extends:__28 | kind: ; value: "word" | ||
| response#3 | response.automation.trigger.excludeKeywords | array<string> | __29 | Yes | ||
| response#3 | response.automation.trigger.excludeKeywords[] | string | __30 | |||
| response#3 | response.automation.actions | object | __31 | Yes | ||
| response#3 | response.automation.actions.publicReplies | array<string> | __32 | Yes | ||
| response#3 | response.automation.actions.publicReplies[] | string | __33 | |||
| response#3 | response.automation.actions.dmMessage | string | __34 | Yes | ||
| response#3 | response.automation.stats | object | __35 | Yes | ||
| response#3 | response.automation.stats.triggered | number | __36 | Yes | ||
| response#3 | response.automation.stats.succeeded | number | __37 | Yes | ||
| response#3 | response.automation.stats.failed | number | __38 | Yes | ||
| response#3 | response.automation.stats.lastRunAt | string | null | __39 | Yes | ||
| response#3 | response.automation.stats.lastRunAt[variant1] | string | __39_extends:__40 | kind: ; value: date-time | ||
| response#3 | response.automation.stats.lastRunAt[variant2] | null | __39_extends:__41 | |||
| response#3 | response.automation.stats.lastError | string | null | __42 | Yes | ||
| response#3 | response.automation.stats.lastError[variant1] | string | __42_extends:__43 | |||
| response#3 | response.automation.stats.lastError[variant2] | null | __42_extends:__44 | |||
| response#3 | response.automation.createdAt | string | __45 | Yes | kind: ; value: date-time | |
| response#3 | response.automation.updatedAt | string | __46 | Yes | kind: ; value: date-time | |
| response#4 | response | object | __0 | |||
| response#4 | response.success | boolean | __1 | Yes | ||
| response#4 | response.message | string | __2 | Yes |