Skip to content

Update Automation

PUT /public/automation/{automationId}

Update the configuration of an existing content automation, including its trigger conditions and actions.

Endpoint Details

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey))
  • Access Tier: Gold+

Parameters

ParameterTypeRequiredDescription
automationIdstringYesThe unique identifier of the automation.

Request Body

Automation Configuration Guide

For a detailed explanation of all automation modules, schemas, and examples, see the Automation Configuration Guide.

FieldTypeRequiredDescription
configobjectYesAutomation configuration object.

Config Object

FieldTypeRequiredDescription
deleteobjectYesConfiguration for delete comment automation.
replyobjectYesConfiguration for reply comment automation.
likeobjectYesConfiguration for like comment automation.
messageobjectYesConfiguration for DM comment automation.
storyobjectYesConfiguration for story automation.

Delete Object

FieldTypeRequiredDescription
isActivebooleanYesWhether delete automation is active.
typestringNoDelete type. Options: keyword, ai.
keywordsstring[]NoKeywords that trigger comment deletion (used when type is keyword).
promptstringNoAI prompt for determining which comments to delete (used when type is ai).

Reply Object

FieldTypeRequiredDescription
isActivebooleanYesWhether reply automation is active.
typestringNoReply type. Options: text, keyword, ai.
textstringNoStatic reply text (used when type is text).
promptstringNoAI prompt for generating reply text (used when type is ai).
isIncludeContentContextbooleanNoWhether to include the content context in AI prompt.
keywordobjectNoKeyword-based reply configuration (used when type is keyword).
keyword.isExactMatchbooleanNoWhether to match keywords exactly.
keyword.valuesarrayNoArray of keyword-reply pairs.
keyword.values[].keywordstringNoTrigger keyword.
keyword.values[].textstringNoReply text for this keyword.
conditionobjectNoCondition to trigger reply.
condition.isActivebooleanNoWhether condition is active.
condition.isExactMatchbooleanNoWhether to match condition keywords exactly.
condition.keywordsstring[]NoCondition keywords.
exceptionobjectNoException rule configuration to ignore certain comments.
exception.isActivebooleanNoWhether exception rule is active.
exception.isExactMatchbooleanNoWhether to match exception keywords exactly.
exception.keywordsstring[]NoException keywords.
delayobjectNoDelay configuration before replying.
delay.isActivebooleanNoWhether delay is active.
delay.valuenumberNoDelay value.
delay.typestringNoDelay unit. Options: second.

Like Object

FieldTypeRequiredDescription
isActivebooleanYesWhether like automation is active.

Message Object

FieldTypeRequiredDescription
isActivebooleanYesWhether DM automation is active.
typestringNoMessage type. Options: text, keyword, ai.
textstringNoStatic message text (used when type is text).
promptstringNoAI prompt for generating messages (used when type is ai).
openingobjectNoOpening message configuration.
opening.postbackobjectNoPostback button opening configuration.
opening.postback.isActivebooleanNoWhether postback opening is active.
opening.postback.textstringNoOpening text message.
opening.postback.buttonobjectNoPostback button configuration.
opening.postback.button.typestringNoButton type. Options: postback.
opening.postback.button.titlestringNoButton title text.
opening.postback.button.payloadstringNoButton payload identifier.
opening.postback.button.urlstringNoButton URL.
opening.additionalobjectNoAdditional opening configuration.
opening.additional.isActivebooleanNoWhether additional opening is active.
opening.additional.isPreventBeforeFollowbooleanNoWhether to prevent message before user follows.
opening.additional.textstringNoAdditional opening text.
opening.additional.buttonobjectNoAdditional button configuration (same as postback button).
opening.webUrlobjectNoWeb URL opening configuration.
opening.webUrl.textstringNoWeb URL opening text.
opening.webUrl.buttonsarrayNoArray of web URL buttons (same structure as postback button).
keywordobjectNoKeyword-based message config (same structure as Reply keyword).
conditionobjectNoCondition config (same structure as Reply condition).
delayobjectNoDelay config (same structure as Reply delay).

Story Object

Same structure as Message Object.

Example Request

bash
curl -X PUT "https://api.repliz.com/public/automation/680affa5ce12f2f72916f67e" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "delete": {
        "isActive": true,
        "type": "ai",
        "keywords": ["spam", "promo"],
        "prompt": "You are a content moderator. Delete comments that are spam or inappropriate."
      },
      "reply": {
        "isActive": true,
        "type": "ai",
        "text": "Thank you for your comment!",
        "prompt": "You are a friendly social media manager. Reply to comments warmly.",
        "isIncludeContentContext": false,
        "keyword": {
          "isExactMatch": false,
          "values": [
            {
              "keyword": "Hello",
              "text": "Hi there! How can we help?"
            }
          ]
        },
        "condition": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": ["hello"]
        },
        "exception": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": ["hello"]
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      },
      "like": {
        "isActive": true
      },
      "message": {
        "isActive": true,
        "type": "ai",
        "text": "Hello! Thanks for commenting.",
        "prompt": "You are a helpful assistant. Send a friendly DM.",
        "opening": {
          "postback": {
            "isActive": false,
            "text": "Want to know more?",
            "button": {
              "type": "postback",
              "title": "Click Me",
              "payload": "payloadcustompostback",
              "url": "https://repliz.com"
            }
          },
          "additional": {
            "isActive": false,
            "isPreventBeforeFollow": false,
            "text": "Want to know more?",
            "button": {
              "type": "postback",
              "title": "Click Me",
              "payload": "payloadcustompostback",
              "url": "https://repliz.com"
            }
          },
          "webUrl": {
            "text": "Want to know more?",
            "buttons": [
              {
                "type": "postback",
                "title": "Click Me",
                "payload": "payloadcustompostback",
                "url": "https://repliz.com"
              }
            ]
          }
        },
        "keyword": {
          "isExactMatch": false,
          "values": [
            {
              "keyword": "Hello",
              "text": "Hi! Check your DM."
            }
          ]
        },
        "condition": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": ["hello"]
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      },
      "story": {
        "isActive": true,
        "type": "ai",
        "text": "Thanks for watching our story!",
        "prompt": "You are a friendly assistant. Reply to story mentions.",
        "opening": {
          "postback": {
            "isActive": false,
            "text": "Want to know more?",
            "button": {
              "type": "postback",
              "title": "Click Me",
              "payload": "payloadcustompostback",
              "url": "https://repliz.com"
            }
          },
          "additional": {
            "isActive": false,
            "isPreventBeforeFollow": false,
            "text": "Want to know more?",
            "button": {
              "type": "postback",
              "title": "Click Me",
              "payload": "payloadcustompostback",
              "url": "https://repliz.com"
            }
          },
          "webUrl": {
            "text": "Want to know more?",
            "buttons": [
              {
                "type": "postback",
                "title": "Click Me",
                "payload": "payloadcustompostback",
                "url": "https://repliz.com"
              }
            ]
          }
        },
        "keyword": {
          "isExactMatch": false,
          "values": [
            {
              "keyword": "Hello",
              "text": "Hi! Thanks for the mention."
            }
          ]
        },
        "condition": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": ["hello"]
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      }
    }
  }'
javascript
import axios from 'axios';

const automationId = '680affa5ce12f2f72916f67e';

const response = await axios.put(
  `https://api.repliz.com/public/automation/${automationId}`,
  {
    config: {
      delete: {
        isActive: true,
        type: 'ai',
        keywords: ['spam', 'promo'],
        prompt: 'You are a content moderator. Delete comments that are spam or inappropriate.',
      },
      reply: {
        isActive: true,
        type: 'ai',
        text: 'Thank you for your comment!',
        prompt: 'You are a friendly social media manager. Reply to comments warmly.',
        isIncludeContentContext: false,
        keyword: {
          isExactMatch: false,
          values: [
            {
              keyword: 'Hello',
              text: 'Hi there! How can we help?',
            },
          ],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: ['hello'],
        },
        exception: {
          isActive: false,
          isExactMatch: false,
          keywords: ['hello'],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      like: {
        isActive: true,
      },
      message: {
        isActive: true,
        type: 'ai',
        text: 'Hello! Thanks for commenting.',
        prompt: 'You are a helpful assistant. Send a friendly DM.',
        opening: {
          postback: {
            isActive: false,
            text: 'Want to know more?',
            button: {
              type: 'postback',
              title: 'Click Me',
              payload: 'payloadcustompostback',
              url: 'https://repliz.com',
            },
          },
          additional: {
            isActive: false,
            isPreventBeforeFollow: false,
            text: 'Want to know more?',
            button: {
              type: 'postback',
              title: 'Click Me',
              payload: 'payloadcustompostback',
              url: 'https://repliz.com',
            },
          },
          webUrl: {
            text: 'Want to know more?',
            buttons: [
              {
                type: 'postback',
                title: 'Click Me',
                payload: 'payloadcustompostback',
                url: 'https://repliz.com',
              },
            ],
          },
        },
        keyword: {
          isExactMatch: false,
          values: [
            {
              keyword: 'Hello',
              text: 'Hi! Check your DM.',
            },
          ],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: ['hello'],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      story: {
        isActive: true,
        type: 'ai',
        text: 'Thanks for watching our story!',
        prompt: 'You are a friendly assistant. Reply to story mentions.',
        opening: {
          postback: {
            isActive: false,
            text: 'Want to know more?',
            button: {
              type: 'postback',
              title: 'Click Me',
              payload: 'payloadcustompostback',
              url: 'https://repliz.com',
            },
          },
          additional: {
            isActive: false,
            isPreventBeforeFollow: false,
            text: 'Want to know more?',
            button: {
              type: 'postback',
              title: 'Click Me',
              payload: 'payloadcustompostback',
              url: 'https://repliz.com',
            },
          },
          webUrl: {
            text: 'Want to know more?',
            buttons: [
              {
                type: 'postback',
                title: 'Click Me',
                payload: 'payloadcustompostback',
                url: 'https://repliz.com',
              },
            ],
          },
        },
        keyword: {
          isExactMatch: false,
          values: [
            {
              keyword: 'Hello',
              text: 'Hi! Thanks for the mention.',
            },
          ],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: ['hello'],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
    },
  },
  {
    auth: {
      username: 'YOUR_ACCESS_KEY',
      password: 'YOUR_SECRET_KEY',
    },
  },
);

console.log(response.data);
javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');

const automationId = '680affa5ce12f2f72916f67e';

const response = await fetch(
  `https://api.repliz.com/public/automation/${automationId}`,
  {
    method: 'PUT',
    headers: {
      Authorization: `Basic ${credentials}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      config: {
        delete: {
          isActive: true,
          type: 'ai',
          keywords: ['spam', 'promo'],
          prompt: 'You are a content moderator. Delete comments that are spam or inappropriate.',
        },
        reply: {
          isActive: true,
          type: 'ai',
          text: 'Thank you for your comment!',
          prompt: 'You are a friendly social media manager. Reply to comments warmly.',
          isIncludeContentContext: false,
          keyword: {
            isExactMatch: false,
            values: [
              {
                keyword: 'Hello',
                text: 'Hi there! How can we help?',
              },
            ],
          },
          condition: {
            isActive: false,
            isExactMatch: false,
            keywords: ['hello'],
          },
          exception: {
            isActive: false,
            isExactMatch: false,
            keywords: ['hello'],
          },
          delay: {
            isActive: false,
            value: 10,
            type: 'second',
          },
        },
        like: {
          isActive: true,
        },
        message: {
          isActive: true,
          type: 'ai',
          text: 'Hello! Thanks for commenting.',
          prompt: 'You are a helpful assistant. Send a friendly DM.',
          opening: {
            postback: {
              isActive: false,
              text: 'Want to know more?',
              button: {
                type: 'postback',
                title: 'Click Me',
                payload: 'payloadcustompostback',
                url: 'https://repliz.com',
              },
            },
            additional: {
              isActive: false,
              isPreventBeforeFollow: false,
              text: 'Want to know more?',
              button: {
                type: 'postback',
                title: 'Click Me',
                payload: 'payloadcustompostback',
                url: 'https://repliz.com',
              },
            },
            webUrl: {
              text: 'Want to know more?',
              buttons: [
                {
                  type: 'postback',
                  title: 'Click Me',
                  payload: 'payloadcustompostback',
                  url: 'https://repliz.com',
                },
              ],
            },
          },
          keyword: {
            isExactMatch: false,
            values: [
              {
                keyword: 'Hello',
                text: 'Hi! Check your DM.',
              },
            ],
          },
          condition: {
            isActive: false,
            isExactMatch: false,
            keywords: ['hello'],
          },
          delay: {
            isActive: false,
            value: 10,
            type: 'second',
          },
        },
        story: {
          isActive: true,
          type: 'ai',
          text: 'Thanks for watching our story!',
          prompt: 'You are a friendly assistant. Reply to story mentions.',
          opening: {
            postback: {
              isActive: false,
              text: 'Want to know more?',
              button: {
                type: 'postback',
                title: 'Click Me',
                payload: 'payloadcustompostback',
                url: 'https://repliz.com',
              },
            },
            additional: {
              isActive: false,
              isPreventBeforeFollow: false,
              text: 'Want to know more?',
              button: {
                type: 'postback',
                title: 'Click Me',
                payload: 'payloadcustompostback',
                url: 'https://repliz.com',
              },
            },
            webUrl: {
              text: 'Want to know more?',
              buttons: [
                {
                  type: 'postback',
                  title: 'Click Me',
                  payload: 'payloadcustompostback',
                  url: 'https://repliz.com',
                },
              ],
            },
          },
          keyword: {
            isExactMatch: false,
            values: [
              {
                keyword: 'Hello',
                text: 'Hi! Thanks for the mention.',
              },
            ],
          },
          condition: {
            isActive: false,
            isExactMatch: false,
            keywords: ['hello'],
          },
          delay: {
            isActive: false,
            value: 10,
            type: 'second',
          },
        },
      },
    }),
  },
);

const data = await response.json();
console.log(data);

Response

json
// No content returned on success
json
{
  "code": 404,
  "message": "automation not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}