Skip to content

Get Broadcast Audience ​

GEThttps://api.repliz.com/public/broadcast/audience

List the chats of an account that a broadcast can go to now, newest first. Send their _id as chatIds to Create Broadcast, or skip this step with isAll.

Endpoint Details ​

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Repliz
  • Scope (Bearer only): broadcast:read (or broadcast:write)
  • Access Tier: Premium+

Parameters ​

ParameterTypeRequiredDescription
accountIdstringYesThe Facebook, Instagram, TikTok, or Telegram account, the _id from Get Account. Other platforms fail with 400, and so does a disconnected account.
audiencestringYesunreplied lists the chats whose last message came from the other person, so nobody answered them yet. all lists every chat.
pagenumberYesPage to return, starting from 1. Pages go up to the 1,000 newest chats, the most one broadcast can go to.
limitnumberYesItems per page, from 1 to 100, for example 50.
searchstringNoMatches the name of the person, case-insensitive. total still counts the whole audience.

24-hour window

Facebook, Instagram, and TikTok only let a business message someone within 24 hours of that person's last message, so only chats whose last message from the person is less than 24 hours old are listed. The window closes 24 hours after lastMessage.fromSenderAt. Telegram has no window.

Example Request ​

bash
curl -X GET "https://api.repliz.com/public/broadcast/audience?accountId=680affa5ce12f2f72916f67e&audience=unreplied&page=1&limit=50" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"
javascript
import axios from 'axios';

const response = await axios.get('https://api.repliz.com/public/broadcast/audience', {
  params: {
    accountId: '680affa5ce12f2f72916f67e',
    audience: 'unreplied',
    page: 1,
    limit: 50,
  },
  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/broadcast/audience?accountId=680affa5ce12f2f72916f67e&audience=unreplied&page=1&limit=50',
  {
    headers: {
      Authorization: `Basic ${credentials}`,
    },
  },
);

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

Response ​

FieldTypeDescription
docsobject[]The chats: _id, senderId, senderName, senderPicture, unreadCount, and lastMessage (text, type, isFromMe, sendAt, and fromSenderAt, the last message from the person).
totalnumberEvery chat in the audience, whatever the search. A broadcast to the whole audience goes to up to 1,000 of them.
totalDocsnumberChats that match the search.
pagenumberThe page returned.
limitnumberItems per page.
hasNextPagebooleanWhether another page follows, within the 1,000 newest chats.
json
{
  "docs": [
    {
      "_id": "6927e1c2e4b0a1f2c3d4e5f7",
      "senderId": "1784140123456789",
      "senderName": "Azickri",
      "senderPicture": "https://scontent.cdninstagram.com/v/t51.2885-19/azickri.jpg",
      "unreadCount": 1,
      "accountId": "680affa5ce12f2f72916f67e",
      "lastMessage": {
        "isFromMe": false,
        "senderId": "1784140123456789",
        "messageId": "aWdfZAG1faWQ6...",
        "type": "text",
        "status": "unread",
        "text": "Kak, pesananku kapan dikirim?",
        "sendAt": "2026-11-27T06:00:00.000Z",
        "fromSenderAt": "2026-11-27T06:00:00.000Z"
      }
    }
  ],
  "total": 1,
  "totalDocs": 1,
  "page": 1,
  "limit": 50,
  "hasNextPage": false
}
json
{
  "code": 400,
  "message": "broadcast is not available for threads"
}
json
{
  "code": 401,
  "message": "unauthorized"
}