Skip to content

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.

Optional request body field map
FieldRequiredTypeConstraints or enum
nameOptionalstring1 <= length <= 100
statusOptionalstring"active" | "paused"
postScopeOptionalstring"any" | "specific"
platformPostIdOptionalstring1 <= length
postPermalinkOptionalstringFormat: uri
keywordsOptionalarray<string>items <= 20; each item 1 <= length <= 60
matchModeOptionalstring"exact" | "contains" | "word"
excludeKeywordsOptionalarray<string>items <= 20; each item 1 <= length <= 60
publicRepliesOptionalarray<string>items <= 5; each item 1 <= length <= 500
dmMessageOptionalstring1 <= length <= 1000

All request body fields are optional in the source contract. Omitted-field behavior is not described in the source.

Failure matrix for Update Comment Automation API
StatusContent typeResponse fieldsHow to check it
200application/jsonsuccess: boolean; automation: object with id, accountId, platform, name, status, trigger, actions, stats, createdAt, updatedAtConfirm the returned automation values and nested trigger, actions and stats objects.
400application/jsonsuccess: boolean; message: stringRecheck the request body against the field map, including types, lengths, item limits and enum values.
403application/jsonsuccess: boolean; message: stringRecheck the x-access-key header and its <token> value.
404application/jsonsuccess: boolean; message: stringRecheck 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.

Worked PATCH example for Update Comment Automation API
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."
  }'
200 response body for Update Comment Automation API
{
  "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"
  }
}
Error response body shape for 400, 403 and 404
{
  "success": true,
  "message": "string"
}
Interface fields
ScopeFieldTypeType referenceRequiredDescriptionConstraints
id#1idstring__0Yes
body#2bodyobject__0Yes
body#2body.namestring__1Nokind: ; value: 1 <= length <= 100
body#2body.statusstring__2No
body#2body.status[variant1]string__2_extends:__3kind: ; value: "active"
body#2body.status[variant2]string__2_extends:__4kind: ; value: "paused"
body#2body.postScopestring__5No
body#2body.postScope[variant1]string__5_extends:__6kind: ; value: "any"
body#2body.postScope[variant2]string__5_extends:__7kind: ; value: "specific"
body#2body.platformPostIdstring__8Nokind: ; value: 1 <= length
body#2body.postPermalinkstring__9Nokind: ; value: uri
body#2body.keywordsarray<string>__10Nokind: ; value: items <= 20
body#2body.keywords[]string__11kind: ; value: 1 <= length <= 60
body#2body.matchModestring__12No
body#2body.matchMode[variant1]string__12_extends:__13kind: ; value: "exact"
body#2body.matchMode[variant2]string__12_extends:__14kind: ; value: "contains"
body#2body.matchMode[variant3]string__12_extends:__15kind: ; value: "word"
body#2body.excludeKeywordsarray<string>__16Nokind: ; value: items <= 20
body#2body.excludeKeywords[]string__17kind: ; value: 1 <= length <= 60
body#2body.publicRepliesarray<string>__18Nokind: ; value: items <= 5
body#2body.publicReplies[]string__19kind: ; value: 1 <= length <= 500
body#2body.dmMessagestring__20Nokind: ; value: 1 <= length <= 1000
response#3responseobject__0
response#3response.successboolean__1Yes
response#3response.automationobject__2Yes
response#3response.automation.idstring__3Yes
response#3response.automation.accountIdstring__4Yes
response#3response.automation.platformstring__5Yes
response#3response.automation.namestring__6Yes
response#3response.automation.statusstring__7Yes
response#3response.automation.status[variant1]string__7_extends:__8kind: schemaValueIn; value: "active"
response#3response.automation.status[variant2]string__7_extends:__9kind: schemaValueIn; value: "paused"
response#3response.automation.triggerobject__10Yes
response#3response.automation.trigger.postScopestring__11Yes
response#3response.automation.trigger.postScope[variant1]string__11_extends:__12kind: schemaValueIn; value: "any"
response#3response.automation.trigger.postScope[variant2]string__11_extends:__13kind: ; value: "specific"
response#3response.automation.trigger.platformPostIdstring | null__14Yes
response#3response.automation.trigger.platformPostId[variant1]string__14_extends:__15
response#3response.automation.trigger.platformPostId[variant2]null__14_extends:__16
response#3response.automation.trigger.postPermalinkstring | null__17Yes
response#3response.automation.trigger.postPermalink[variant1]string__17_extends:__18
response#3response.automation.trigger.postPermalink[variant2]null__17_extends:__19
response#3response.automation.trigger.postIdstring | null__20Yes
response#3response.automation.trigger.postId[variant1]string__20_extends:__21
response#3response.automation.trigger.postId[variant2]null__20_extends:__22
response#3response.automation.trigger.keywordsarray<string>__23Yes
response#3response.automation.trigger.keywords[]string__24
response#3response.automation.trigger.matchModestring__25Yes
response#3response.automation.trigger.matchMode[variant1]string__25_extends:__26kind: ; value: "exact"
response#3response.automation.trigger.matchMode[variant2]string__25_extends:__27kind: ; value: "contains"
response#3response.automation.trigger.matchMode[variant3]string__25_extends:__28kind: ; value: "word"
response#3response.automation.trigger.excludeKeywordsarray<string>__29Yes
response#3response.automation.trigger.excludeKeywords[]string__30
response#3response.automation.actionsobject__31Yes
response#3response.automation.actions.publicRepliesarray<string>__32Yes
response#3response.automation.actions.publicReplies[]string__33
response#3response.automation.actions.dmMessagestring__34Yes
response#3response.automation.statsobject__35Yes
response#3response.automation.stats.triggerednumber__36Yes
response#3response.automation.stats.succeedednumber__37Yes
response#3response.automation.stats.failednumber__38Yes
response#3response.automation.stats.lastRunAtstring | null__39Yes
response#3response.automation.stats.lastRunAt[variant1]string__39_extends:__40kind: ; value: date-time
response#3response.automation.stats.lastRunAt[variant2]null__39_extends:__41
response#3response.automation.stats.lastErrorstring | null__42Yes
response#3response.automation.stats.lastError[variant1]string__42_extends:__43
response#3response.automation.stats.lastError[variant2]null__42_extends:__44
response#3response.automation.createdAtstring__45Yeskind: ; value: date-time
response#3response.automation.updatedAtstring__46Yeskind: ; value: date-time
response#4responseobject__0
response#4response.successboolean__1Yes
response#4response.messagestring__2Yes