Appearance
Create Template
POST/public/templateCreate 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.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the automation template. |
config | object | Yes | Automation configuration object (see below). |
Config Object
| Field | Type | Required | Description |
|---|---|---|---|
delete | object | Yes | Configuration for delete comment automation. |
reply | object | Yes | Configuration for reply comment automation. |
like | object | Yes | Configuration for like comment automation. |
message | object | Yes | Configuration for DM comment automation. |
chat | object | Yes | Configuration for chat automation. |
story | object | Yes | Configuration for story automation. |
Delete Object
| Field | Type | Required | Description |
|---|---|---|---|
isActive | boolean | Yes | Whether delete automation is active. |
type | string | No | Delete type. Options: keyword, ai. |
keywords | string[] | No | Keywords that trigger comment deletion (used when type is keyword). |
prompt | string | No | AI prompt for determining which comments to delete (used when type is ai). |
Reply Object
| Field | Type | Required | Description |
|---|---|---|---|
isActive | boolean | Yes | Whether reply automation is active. |
type | string | No | Reply type. Options: text, keyword, ai. |
text | string | No | Static reply text (used when type is text). |
prompt | string | No | AI prompt for generating reply text (used when type is ai). |
isIncludeContentContext | boolean | No | Whether to include the content context in AI prompt. |
keyword | object | No | Keyword-based reply configuration (used when type is keyword). |
keyword.isExactMatch | boolean | No | Whether to match keywords exactly. |
keyword.values | array | No | Array of keyword-reply pairs. |
keyword.values[].keyword | string | No | Trigger keyword. |
keyword.values[].text | string | No | Reply text for this keyword. |
condition | object | No | Condition to trigger reply. |
condition.isActive | boolean | No | Whether condition is active. |
condition.isExactMatch | boolean | No | Whether to match condition keywords exactly. |
condition.keywords | string[] | No | Condition keywords. |
exception | object | No | Exception rule configuration to ignore certain comments. |
exception.isActive | boolean | No | Whether exception rule is active. |
exception.isExactMatch | boolean | No | Whether to match exception keywords exactly. |
exception.keywords | string[] | No | Exception keywords. |
delay | object | No | Delay configuration before replying. |
delay.isActive | boolean | No | Whether delay is active. |
delay.value | number | No | Delay value. |
delay.type | string | No | Delay unit. Options: second, minute. |
Like Object
| Field | Type | Required | Description |
|---|---|---|---|
isActive | boolean | Yes | Whether like automation is active. |
Message Object
| Field | Type | Required | Description |
|---|---|---|---|
isActive | boolean | Yes | Whether DM automation is active. |
type | string | No | Message type. Options: text, keyword, ai, opening. |
text | string | No | Static message text (used when type is text). |
prompt | string | No | AI prompt for generating messages (used when type is ai). |
opening | object | No | Opening message configuration. |
opening.postback | object | No | Postback button opening configuration. |
opening.postback.isActive | boolean | No | Whether postback opening is active. |
opening.postback.text | string | No | Opening text message. |
opening.postback.image | string | No | Opening image URL. |
opening.postback.button | object | No | Postback button configuration. |
opening.postback.button.type | string | No | Button type. Options: postback, web_url. |
opening.postback.button.title | string | No | Button title text. |
opening.postback.button.payload | string | No | Button payload identifier. |
opening.postback.button.url | string | No | Button URL. |
opening.additional | object | No | Additional opening configuration. |
opening.additional.isActive | boolean | No | Whether additional opening is active. |
opening.additional.isPreventBeforeFollow | boolean | No | Whether to prevent message before user follows. |
opening.additional.text | string | No | Additional opening text. |
opening.additional.image | string | No | Additional opening image URL. |
opening.additional.button | object | No | Additional button configuration (same as postback button). |
opening.webUrl | object | No | Web URL opening configuration. |
opening.webUrl.text | string | No | Web URL opening text. |
opening.webUrl.image | string | No | Web URL opening image URL. |
opening.webUrl.buttons | array | No | Array of web URL buttons (same structure as postback button). |
keyword | object | No | Keyword-based message config (same structure as Reply keyword). |
condition | object | No | Condition config (same structure as Reply condition). |
delay | object | No | Delay config (same structure as Reply delay). |
Chat Object
| Field | Type | Required | Description |
|---|---|---|---|
isActive | boolean | Yes | Whether chat automation is active. |
type | string | No | Chat response mode. Options: text, keyword, ai. |
text | string | No | Static response text (used when type is text). |
prompt | string | No | AI prompt for generating responses (used when type is ai). |
keyword | object | No | Keyword-based chat config (same structure as Reply keyword). |
delay | object | No | Delay config before responding (same structure as Reply delay). |
Story Object
Same structure as Message Object.
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"
}