Skip to content

Create Automation ​

POST /public/automation

Create a new content automation with delete, reply, like, message, and story configurations attached to a specific content.

Endpoint Details ​

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

Request Body ​

Automation Configuration Guide

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

FieldTypeRequiredDescription
contentIdstringYesThe content ID to attach the automation to (e.g. 113958387982006_942538351814577).
accountIdstringYesThe account ID to associate with the automation.
configobjectYesAutomation configuration object (see below).

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.
typestringYesDelete type. Options: keyword, ai.
keywordsstring[]YesKeywords that trigger comment deletion (used when type is keyword).
promptstringYesAI prompt for determining which comments to delete (used when type is ai).

Reply Object ​

FieldTypeRequiredDescription
isActivebooleanYesWhether reply automation is active.
typestringYesReply type. Options: text, keyword, ai.
textstringYesStatic reply text (used when type is text).
imageobjectNoImage sent along with every reply, for all three types. See Reply Image.
image.urlstringYesPublic URL of the image file.
image.mimetypestringYesMIME type of the image, like image/jpeg.
image.thumbnailstringNoSmaller preview shown in Repliz.
promptstringYesAI prompt for generating reply text (used when type is ai).
isIncludeContentContextbooleanYesWhether to include the content context in AI prompt.
isIncludeLiveCommentbooleanNoInstagram only. Also reply to comments on an Instagram Live. Off when left out. See Instagram Live comments.
keywordobjectYesKeyword-based reply configuration (used when type is keyword).
keyword.isExactMatchbooleanYesWhether to match keywords exactly.
keyword.valuesarrayYesArray of keyword-reply pairs.
keyword.values[].keywordstringYesTrigger keyword.
keyword.values[].textstringYesReply text for this keyword.
conditionobjectYesCondition to trigger reply.
condition.isActivebooleanYesWhether condition is active.
condition.isExactMatchbooleanYesWhether to match condition keywords exactly.
condition.keywordsstring[]YesCondition keywords.
exceptionobjectYesException rule configuration to ignore certain comments.
exception.isActivebooleanYesWhether exception rule is active.
exception.isExactMatchbooleanYesWhether to match exception keywords exactly.
exception.keywordsstring[]YesException keywords.
delayobjectYesDelay configuration before replying.
delay.isActivebooleanYesWhether delay is active.
delay.valuenumberYesDelay in seconds. The dashboard offers 10 to 60.
delay.typestringYesUse second. The value is always treated as seconds.

Like Object ​

FieldTypeRequiredDescription
isActivebooleanYesWhether like automation is active.

Message Object ​

FieldTypeRequiredDescription
isActivebooleanYesWhether DM automation is active.
typestringYesMessage type. Options: text, keyword, ai, opening.
textstringYesStatic message text (used when type is text).
promptstringYesAI prompt for generating messages (used when type is ai).
isIncludeLiveCommentbooleanNoInstagram only. Also DM commenters on an Instagram Live, while it is on air. Off when left out. See Instagram Live comments.
openingobjectYesOpening message configuration.
opening.postbackobjectYesPostback button opening configuration.
opening.postback.isActivebooleanYesWhether postback opening is active.
opening.postback.textstringYesOpening text message.
opening.postback.buttonobjectYesPostback button configuration.
opening.postback.button.typestringYesButton type. Options: postback.
opening.postback.button.titlestringYesButton title text.
opening.postback.button.payloadstringNoSet by Repliz when the automation is saved. Any value you send is replaced.
opening.postback.button.urlstringNoButton URL.
opening.additionalobjectYesAdditional opening configuration.
opening.additional.isActivebooleanYesWhether additional opening is active.
opening.additional.isPreventBeforeFollowbooleanYesWhether to prevent message before user follows.
opening.additional.textstringYesAdditional opening text.
opening.additional.buttonobjectYesAdditional button configuration (same as postback button).
opening.webUrlobjectYesWeb URL opening configuration.
opening.webUrl.typestringNobutton (default) sends text, image, and buttons. element sends a carousel of elements.
opening.webUrl.textstringYesWeb URL opening text. Not sent when type is element.
opening.webUrl.imagestringNoWeb URL opening image URL. Not sent when type is element.
opening.webUrl.buttonsarrayYesUp to 3 link buttons, each { "type": "web_url", "title", "url" }. Not sent when type is element.
opening.webUrl.elementsarrayNo1 to 10 carousel cards. Required when type is element. See Carousel.
opening.webUrl.elements[].titlestringYesCard title, cut to 80 characters. Supports spintax.
opening.webUrl.elements[].subtitlestringNoText under the title, cut to 80 characters. Supports spintax.
opening.webUrl.elements[].imagestringNoCard image URL.
opening.webUrl.elements[].urlstringNoURL opened when the card itself is tapped.
opening.webUrl.elements[].buttonsarrayYesUp to 3 link buttons, each { "type": "web_url", "title", "url" }. Can be empty.
keywordobjectYesKeyword-based message config (same structure as Reply keyword). Each keyword can also answer with buttons. See Keyword with Buttons.
keyword.values[].typestringNotext (default) answers with text. opening answers with this keyword's own opening.
keyword.values[].openingobjectNoSame structure as opening. Required when type is opening.
keyword.values[].idstringNoSet by Repliz for keywords with type: "opening". Send it back unchanged so buttons already sent keep working.
conditionobjectYesCondition config (same structure as Reply condition).
delayobjectYesDelay config (same structure as Reply delay).

Story Object ​

Same structure as Message Object.

Example Request ​

bash
curl -X POST "https://api.repliz.com/public/automation" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "contentId": "113958387982006_942538351814577",
    "accountId": "680affa5ce12f2f72916f67e",
    "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": "web_url",
                "title": "Click Me",
                "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": "web_url",
                "title": "Click Me",
                "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 response = await axios.post(
  'https://api.repliz.com/public/automation',
  {
    contentId: '113958387982006_942538351814577',
    accountId: '680affa5ce12f2f72916f67e',
    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: 'web_url',
                title: 'Click Me',
                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: 'web_url',
                title: 'Click Me',
                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 response = await fetch('https://api.repliz.com/public/automation', {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    contentId: '113958387982006_942538351814577',
    accountId: '680affa5ce12f2f72916f67e',
    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: 'web_url',
                title: 'Click Me',
                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: 'web_url',
                title: 'Click Me',
                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
{
  "automationId": "69c7532ff0c3b7c83ab9e681"
}
json
// Automation
{
  "code": 404,
  "message": "automation not found"
}

// Account
{
  "code": 404,
  "message": "account not found"
}

// Content
{
  "code": 404,
  "message": "content not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}