Skip to content

Update Template ​

PUT /public/template/{templateId}

Update the name, configuration, or automation rules of an existing automation template.

Endpoint Details ​

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

Parameters ​

ParameterTypeRequiredDescription
templateIdstringYesThe unique identifier of the automation template.

Request Body ​

Automation Configuration Guide

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

FieldTypeRequiredDescription
namestringYesName of the automation template.
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.
chatobjectYesConfiguration for chat 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.imagestringNoOpening image URL.
opening.postback.buttonobjectYesPostback button configuration.
opening.postback.button.typestringYesButton type. Options: postback, web_url.
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.imagestringNoAdditional opening image URL.
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).

Chat Object ​

FieldTypeRequiredDescription
isActivebooleanYesWhether chat automation is active.
typestringYesChat response mode. Options: text, keyword, ai.
textstringYesStatic response text (used when type is text).
promptstringYesAI prompt for generating responses (used when type is ai).
keywordobjectYesKeyword-based chat config (same structure as Message keyword). On Facebook and Instagram, a keyword can also answer with buttons. See Keyword with Buttons.
delayobjectYesDelay config before responding (same structure as Reply delay).

Story Object ​

Same structure as Message Object.

Example Request ​

bash
curl -X PUT "https://api.repliz.com/public/template/6a912e6c8133bfb870b220d3" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Auto Comment Updated",
    "config": {
      "delete": {
        "isActive": true,
        "type": "keyword",
        "keywords": ["Jobless", "spam"],
        "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 visit our website",
        "prompt": "",
        "keyword": {
          "isExactMatch": false,
          "values": []
        },
        "delay": {
          "isActive": false,
          "value": 10,
          "type": "second"
        }
      }
    }
  }'
javascript
import axios from 'axios';

const templateId = '6a912e6c8133bfb870b220d3';

const response = await axios.put(
  `https://api.repliz.com/public/template/${templateId}`,
  {
    name: 'Auto Comment Updated',
    config: {
      delete: {
        isActive: true,
        type: 'keyword',
        keywords: ['Jobless', 'spam'],
        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 visit our 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 templateId = '6a912e6c8133bfb870b220d3';

const response = await fetch(
  `https://api.repliz.com/public/template/${templateId}`,
  {
    method: 'PUT',
    headers: {
      Authorization: `Basic ${credentials}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'Auto Comment Updated',
      config: {
        delete: {
          isActive: true,
          type: 'keyword',
          keywords: ['Jobless', 'spam'],
          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 visit our website',
          prompt: '',
          keyword: {
            isExactMatch: false,
            values: [],
          },
          delay: {
            isActive: false,
            value: 10,
            type: 'second',
          },
        },
      },
    }),
  },
);

console.log(response.status);

Response ​

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