Skip to content

Create Template ​

POSThttps://api.repliz.com/public/template

Create a new reusable automation template containing comment moderation, replies, likes, direct messages, stories, and chat rules.

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
namestringYesName shown in the template list, for example Giveaway replies. Search in Get Template matches it.
configobjectYesThe automation modules saved in the template: delete, reply, like, message, chat, and story. Send every module, with isActive: false for the ones you don't use.

Config Object ​

FieldTypeRequiredDescription
deleteobjectYesDeletes matching comments. See Delete Object.
replyobjectYesReplies to comments in public. See Reply Object.
likeobjectYesLikes comments. See Like Object.
messageobjectYesSends a DM to the people who comment. See Message Object.
chatobjectYesAnswers direct messages sent to the account. See Chat Object.
storyobjectYesSends a DM to the people who reply to an Instagram Story. See Story Object.

Delete Object ​

Deletes new comments that match. On YouTube, other people's comments are hidden with the moderation status rejected instead. See the Delete Module.

FieldTypeRequiredDescription
isActivebooleanYesTurns the module on. With false, the other fields are saved but not used.
typestringYesHow a comment is picked: keyword deletes comments that contain one of keywords, ai asks the AI whether the comment fits prompt.
keywordsstring[]YesWords or phrases to delete on, used by keyword. Case-insensitive, and a comment matches when it contains one anywhere. Send [] when type is ai. Empty ones are ignored.
promptstringYesWhat the AI should delete, used by ai, for example Delete spam, scam links, and hate speech. Send "" when type is keyword.

Reply Object ​

Posts a public reply under new comments. See the Reply Module.

FieldTypeRequiredDescription
isActivebooleanYesTurns the module on. With false, the other fields are saved but not used.
typestringYesWhere the reply comes from: text always sends text, keyword sends the matching item of keyword.values, ai lets the AI write it from prompt.
textstringYesThe reply for text. Supports {name} for the commenter's name and spintax such as {Hi|Hello}. Send "" for the other types.
imageobjectNoAn image posted with every reply, whatever the type. Sent on Facebook, Threads, TikTok, and LinkedIn, and ignored on Instagram and YouTube. See image Object.
image.urlstringYesPublic URL of the image. The platform downloads it from here.
image.mimetypestringYesMIME type of the image, like image/jpeg or image/png.
image.thumbnailstringNoSmaller preview shown in Repliz. It isn't sent to the platform.
promptstringYesInstructions for ai: tone, language, and what the reply should say. Send "" for the other types.
isIncludeContentContextbooleanYesUsed by ai. With true, the AI also reads the post's title, type, caption, and media, so it can answer questions about the post itself.
isIncludeLiveCommentbooleanNoInstagram only. Also reply to comments on an Instagram Live. Off when left out. See Instagram Live comments.
keywordobjectYesKeyword replies, used by keyword. For the other types, send it with values: [].
keyword.isExactMatchbooleanYesfalse: a keyword matches when the comment contains it. true: the whole comment must equal the keyword. Case-insensitive either way.
keyword.valuesarrayYesKeyword and reply pairs. They're checked in order and the first match is sent. A comment that matches none gets the reply of the item with an empty keyword, or no reply when there is none.
keyword.values[].keywordstringYesThe word or phrase to match. Leave it empty for the default reply to comments no other keyword matches, wherever it sits in the list. With more than one empty keyword, the first one is used.
keyword.values[].textstringYesThe reply for this keyword. Supports {name} and spintax.
exceptionobjectNoComments that never get a reply. Checked first, for every type. Off when left out.
exception.isActivebooleanYesTurns the exception list on.
exception.isExactMatchbooleanYesfalse: skip comments that contain a keyword. true: skip only comments equal to a keyword.
exception.keywordsstring[]YesKeywords that block the reply, for example ["admin", "giveaway"]. Empty ones are ignored.
conditionobjectYesReply only to comments with one of these keywords. Ignored when type is keyword, because keyword.values already decides.
condition.isActivebooleanYesTurns the condition on. With false, every comment that passes exception gets a reply.
condition.isExactMatchbooleanYesfalse: the comment must contain a keyword. true: it must equal one.
condition.keywordsstring[]YesKeywords a comment needs to get a reply. Empty ones are ignored.
delayobjectYesWaits before replying, so replies don't arrive the same second as the comment.
delay.isActivebooleanYesTurns the delay on.
delay.valuenumberYesHow long to wait, in seconds. The dashboard offers 10 to 60.
delay.typestringYesSend second. The value is always read as seconds.

Like Object ​

Likes new comments. Runs on Facebook, TikTok, and LinkedIn.

FieldTypeRequiredDescription
isActivebooleanYesLikes every new comment from other people.

Message Object ​

Sends a private DM to the person who commented. Runs on Facebook and Instagram. See the Message Module.

FieldTypeRequiredDescription
isActivebooleanYesTurns the module on. With false, the other fields are saved but not used.
typestringYesWhat is sent: text sends text, ai lets the AI write it from prompt, keyword sends the matching item of keyword.values, opening sends the button flow in opening.
textstringYesThe DM for text. Supports {name} and spintax. Send "" for the other types.
promptstringYesInstructions for ai. Send "" for the other types.
isIncludeLiveCommentbooleanNoInstagram only. Also DM commenters on an Instagram Live, while it is on air. Off when left out. See Instagram Live comments.
openingobjectYesThe button flow for opening: First Message, Additional Message, then Follow-up Message with your links. See Opening Flow. Send it for every type.
opening.postbackobjectYesFirst Message, sent right after the comment. Its button only asks the person to tap, which lets Repliz send the rest.
opening.postback.isActivebooleanYesWith false, the flow starts at additional, or at webUrl if that is off too.
opening.postback.textstringYesMessage text. Supports {name} and spintax.
opening.postback.imagestringNoPublic image URL shown above the text.
opening.postback.buttonobjectYesThe one button of this message.
opening.postback.button.typestringYesSend postback.
opening.postback.button.titlestringYesButton label, for example Send me the link.
opening.postback.button.payloadstringNoSet by Repliz when the automation is saved. Any value you send is replaced.
opening.postback.button.urlstringNoNot used by postback buttons. Send "".
opening.additionalobjectYesAdditional Message, sent when the person taps the First Message button. Same fields as postback, plus isPreventBeforeFollow.
opening.additional.isActivebooleanYesWith false, tapping the First Message button sends webUrl straight away.
opening.additional.isPreventBeforeFollowbooleanYesInstagram only. With true, the person must follow the account before getting webUrl. Until then, tapping the button sends this message again.
opening.additional.textstringYesMessage text, for example Follow us first, then tap the button again. Supports {name} and spintax.
opening.additional.imagestringNoPublic image URL shown above the text.
opening.additional.buttonobjectYesThe one button of this message, with the same fields as opening.postback.button.
opening.webUrlobjectYesFollow-up Message, the last step, with the links you want to give.
opening.webUrl.typestringNobutton (default) sends text, image, and buttons. element sends a carousel of elements instead.
opening.webUrl.textstringYesMessage text, used by button. Supports {name} and spintax.
opening.webUrl.imagestringNoPublic image URL shown with the message, used by button.
opening.webUrl.buttonsarrayYesUp to 3 link buttons, each { "type": "web_url", "title", "url" }, used by button. Send [] 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 {name} and spintax.
opening.webUrl.elements[].subtitlestringNoText under the title, cut to 80 characters. Supports {name} and spintax.
opening.webUrl.elements[].imagestringNoPublic URL of the card image.
opening.webUrl.elements[].urlstringNoLink opened when the card itself is tapped.
opening.webUrl.elements[].buttonsarrayYesUp to 3 link buttons on the card, each { "type": "web_url", "title", "url" }. Can be [].
keywordobjectYesKeyword DMs, used by keyword, with the same isExactMatch and values as in Reply. For the other types, send it with values: [].
keyword.values[].keywordstringYesThe word or phrase to match. Leave it empty for a fallback that answers comments no other keyword matches, wherever it sits in the list. With more than one empty keyword, the first one is used.
keyword.values[].typestringNotext (default) sends text. opening sends this keyword's own opening. See Keyword with Buttons.
keyword.values[].textstringWhen type is textThe DM for this keyword. Supports {name} and spintax.
keyword.values[].openingobjectWhen type is openingSame structure as opening. Dropped on save when type is text.
keyword.values[].idstringNoSet by Repliz for items with type: "opening". Send it back unchanged when you update, so the buttons in DMs already sent keep working.
conditionobjectYesDM only comments with one of these keywords, with the same fields as in Reply. Ignored when type is keyword.
delayobjectYesWaits before sending, with the same fields as in Reply. Keep it short for Instagram Live comments.

Story Object ​

Sends a DM to people who reply to an Instagram Story. Runs on Instagram only. It has the same fields as the Message Object, except isIncludeLiveComment, and its condition and keyword are matched against the text of the story reply. See the Story Module.

Chat Object ​

Answers direct messages sent to the account. Account level only, on Facebook, Instagram, TikTok, and Telegram. It answers every incoming message, not only the first one in a conversation. See the Chat Module.

FieldTypeRequiredDescription
isActivebooleanYesTurns the module on. With false, the other fields are saved but not used.
typestringYesWhat is sent: text sends text, ai lets the AI write it from prompt, keyword sends the matching item of keyword.values.
textstringYesThe answer for text. Supports {name} and spintax. Send "" for the other types.
promptstringYesInstructions for ai, for example what the business sells and how to answer. Send "" for the other types.
keywordobjectYesKeyword answers, used by keyword, with the same fields as the Message keyword, including the empty fallback keyword. On Facebook and Instagram, an item can answer with buttons.
delayobjectYesWaits before answering, with the same fields as in Reply.

Example Request ​

bash
curl -X POST "https://api.repliz.com/public/template" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Auto Comment",
    "config": {
      "delete": {
        "isActive": true,
        "type": "keyword",
        "keywords": ["Jobless"],
        "prompt": ""
      },
      "reply": {
        "isActive": true,
        "type": "text",
        "text": "Thanks for comment",
        "prompt": "",
        "isIncludeContentContext": false,
        "keyword": {
          "isExactMatch": false,
          "values": []
        },
        "condition": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": []
        },
        "exception": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": []
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      },
      "like": {
        "isActive": true
      },
      "message": {
        "isActive": true,
        "type": "text",
        "text": "Thanks for comment, here we are",
        "prompt": "",
        "opening": {
          "postback": {
            "isActive": false,
            "text": "",
            "image": "",
            "file": null,
            "button": {
              "type": "postback",
              "title": "",
              "payload": ""
            }
          },
          "additional": {
            "isActive": false,
            "isPreventBeforeFollow": false,
            "text": "",
            "image": "",
            "file": null,
            "button": {
              "type": "postback",
              "title": "",
              "payload": ""
            }
          },
          "webUrl": {
            "text": "",
            "image": "",
            "file": null,
            "buttons": []
          }
        },
        "keyword": {
          "isExactMatch": false,
          "values": []
        },
        "condition": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": []
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      },
      "story": {
        "isActive": true,
        "type": "text",
        "text": "Like this story?",
        "prompt": "",
        "opening": {
          "postback": {
            "isActive": false,
            "text": "",
            "image": "",
            "file": null,
            "button": {
              "type": "postback",
              "title": "",
              "payload": ""
            }
          },
          "additional": {
            "isActive": false,
            "isPreventBeforeFollow": false,
            "text": "",
            "image": "",
            "file": null,
            "button": {
              "type": "postback",
              "title": "",
              "payload": ""
            }
          },
          "webUrl": {
            "text": "",
            "image": "",
            "file": null,
            "buttons": []
          }
        },
        "keyword": {
          "isExactMatch": false,
          "values": []
        },
        "condition": {
          "isActive": false,
          "isExactMatch": false,
          "keywords": []
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      },
      "chat": {
        "isActive": true,
        "type": "text",
        "text": "For information, please call a book on website",
        "prompt": "",
        "keyword": {
          "isExactMatch": false,
          "values": []
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      }
    }
  }'
javascript
import axios from 'axios';

const response = await axios.post(
  'https://api.repliz.com/public/template',
  {
    name: 'Auto Comment',
    config: {
      delete: {
        isActive: true,
        type: 'keyword',
        keywords: ['Jobless'],
        prompt: '',
      },
      reply: {
        isActive: true,
        type: 'text',
        text: 'Thanks for comment',
        prompt: '',
        isIncludeContentContext: false,
        keyword: {
          isExactMatch: false,
          values: [],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        exception: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      like: {
        isActive: true,
      },
      message: {
        isActive: true,
        type: 'text',
        text: 'Thanks for comment, here we are',
        prompt: '',
        opening: {
          postback: {
            isActive: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          additional: {
            isActive: false,
            isPreventBeforeFollow: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          webUrl: {
            text: '',
            image: '',
            file: null,
            buttons: [],
          },
        },
        keyword: {
          isExactMatch: false,
          values: [],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      story: {
        isActive: true,
        type: 'text',
        text: 'Like this story?',
        prompt: '',
        opening: {
          postback: {
            isActive: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          additional: {
            isActive: false,
            isPreventBeforeFollow: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          webUrl: {
            text: '',
            image: '',
            file: null,
            buttons: [],
          },
        },
        keyword: {
          isExactMatch: false,
          values: [],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      chat: {
        isActive: true,
        type: 'text',
        text: 'For information, please call a book on website',
        prompt: '',
        keyword: {
          isExactMatch: false,
          values: [],
        },
        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/template', {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Auto Comment',
    config: {
      delete: {
        isActive: true,
        type: 'keyword',
        keywords: ['Jobless'],
        prompt: '',
      },
      reply: {
        isActive: true,
        type: 'text',
        text: 'Thanks for comment',
        prompt: '',
        isIncludeContentContext: false,
        keyword: {
          isExactMatch: false,
          values: [],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        exception: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      like: {
        isActive: true,
      },
      message: {
        isActive: true,
        type: 'text',
        text: 'Thanks for comment, here we are',
        prompt: '',
        opening: {
          postback: {
            isActive: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          additional: {
            isActive: false,
            isPreventBeforeFollow: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          webUrl: {
            text: '',
            image: '',
            file: null,
            buttons: [],
          },
        },
        keyword: {
          isExactMatch: false,
          values: [],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      story: {
        isActive: true,
        type: 'text',
        text: 'Like this story?',
        prompt: '',
        opening: {
          postback: {
            isActive: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          additional: {
            isActive: false,
            isPreventBeforeFollow: false,
            text: '',
            image: '',
            file: null,
            button: {
              type: 'postback',
              title: '',
              payload: '',
            },
          },
          webUrl: {
            text: '',
            image: '',
            file: null,
            buttons: [],
          },
        },
        keyword: {
          isExactMatch: false,
          values: [],
        },
        condition: {
          isActive: false,
          isExactMatch: false,
          keywords: [],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
      chat: {
        isActive: true,
        type: 'text',
        text: 'For information, please call a book on website',
        prompt: '',
        keyword: {
          isExactMatch: false,
          values: [],
        },
        delay: {
          isActive: false,
          value: 10,
          type: 'second',
        },
      },
    },
  }),
});

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

Response ​

json
{
  "_id": "6a912e6c8133bfb870b220d3"
}
json
{
  "code": 401,
  "message": "unauthorized"
}