English
English
Appearance
English
English
Appearance
https://api.repliz.com/public/broadcastSend one message to many chats of a Facebook, Instagram, TikTok, or Telegram account, for example to follow up the chats nobody answered yet.
Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Replizbroadcast:write| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | The Facebook, Instagram, TikTok, or Telegram account to send from, the _id from Get Account. It has to be connected. |
audience | string | Yes | unreplied or all, the list the chats come from, as in Get Broadcast Audience. With unreplied, a chat answered before its turn is skipped. |
delay | number | Yes | Seconds between two messages: 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800, or 3600 (1 hour). |
isAll | boolean | No | true sends to the whole audience (its 1,000 newest chats) except excludedChatIds, without listing it first. Otherwise chatIds says who gets it. |
chatIds | string[] | Unless isAll | Up to 1,000 chat _ids from Get Broadcast Audience. Chats that no longer match the audience are left out. |
excludedChatIds | string[] | No | With isAll, the chats to leave out. |
text | string | Unless media | Up to 1,000 characters. {name} becomes each person's name and {Hi|Hello} picks one at random, so each person gets their own version. |
media | object | No | One image or video, sent right after the text as its own message, see the Media Object. Facebook, Instagram, and Telegram only. |
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | image or video. |
url | string | Yes | Public URL of the file, for example from Storage. The platform downloads it from here. |
mimetype | string | Yes | For example image/jpeg or video/mp4. |
thumbnail | string | No | Preview shown in Repliz, and the video cover on Telegram. |
duration | number | No | Video length in seconds. |
delay seconds apart. On Facebook, Instagram, and TikTok the chats closest to the end of their 24-hour window go first.unreplied, is skipped. Telegram has no window.curl -X POST "https://api.repliz.com/public/broadcast" \
-H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{
"accountId": "680affa5ce12f2f72916f67e",
"audience": "unreplied",
"delay": 5,
"isAll": true,
"excludedChatIds": [],
"text": "{Halo|Hai} {name}, maaf baru sempat balas 🙏 Ada yang bisa kami bantu?"
}'import axios from 'axios';
const response = await axios.post(
'https://api.repliz.com/public/broadcast',
{
accountId: '680affa5ce12f2f72916f67e',
audience: 'unreplied',
delay: 5,
isAll: true,
excludedChatIds: [],
text: '{Halo|Hai} {name}, maaf baru sempat balas 🙏 Ada yang bisa kami bantu?',
},
{
auth: {
username: 'YOUR_ACCESS_KEY',
password: 'YOUR_SECRET_KEY',
},
},
);
console.log(response.data);const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');
const response = await fetch('https://api.repliz.com/public/broadcast', {
method: 'POST',
headers: {
Authorization: `Basic ${credentials}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
accountId: '680affa5ce12f2f72916f67e',
audience: 'unreplied',
delay: 5,
isAll: true,
excludedChatIds: [],
text: '{Halo|Hai} {name}, maaf baru sempat balas 🙏 Ada yang bisa kami bantu?',
}),
});
const data = await response.json();
console.log(data);| Field | Type | Description |
|---|---|---|
broadcastId | string | ID of the new broadcast. |
total | number | Chats it goes to. |
{
"broadcastId": "6927e1c2e4b0a1f2c3d4e5f6",
"total": 120
}{
"code": 400,
"message": "none of the chats can receive a broadcast now"
}{
"code": 404,
"message": "account not found"
}{
"code": 409,
"message": "a broadcast is still running on this account"
}{
"code": 401,
"message": "unauthorized"
}