Skip to content

Create Keyword Watch ​

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

Watch Threads for new posts by other people that contain a keyword and fit a description, and reply to them from a Threads account.

Endpoint Details ​

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

Request Body ​

FieldTypeRequiredDescription
keywordstringYesOne keyword or phrase to search Threads for, up to 100 characters. With mode KEYWORD, a post is kept only when it contains every word of it, in its text, image description, article, or topic tag.
filterobjectNoNarrows the search, see the Filter Object. The newest posts are always used.
excludesstring[]NoUp to 20 words or phrases, up to 50 characters each. A post that contains one of them is skipped before anything else, case-insensitive, without AI.
criteriastringNoWhich of the found posts to keep, described in plain words, up to 1,000 characters, for example People asking for a coffee shop recommendation in Jakarta, not ads or news. It is read by the AI of your AI setting (your own key or Repliz tokens), which has to be set up first. Empty keeps every post with the keyword, and then approval auto isn't allowed.
accountIdstringYesID of the Threads account that searches and replies, the _id from Get Account. Other platforms fail with 400. To watch the same keyword with another account, create another keyword watch.
replyobjectYesWhat the account does with the posts it finds, see the Reply Object.

Filter Object ​

FieldTypeRequiredDescription
modestringNoKEYWORD (default) searches the text, TAG searches topic tags. Empty means KEYWORD.
typestringNoTEXT, IMAGE, or VIDEO. Empty for every type.
usernamestringNoOnly posts by this Threads username, with or without @. Empty for everyone.
isIncludeRepliesbooleanNotrue also keeps posts that are replies inside someone else's thread, so they can get a reply too. false (default) keeps only main posts.

Reply Object ​

FieldTypeRequiredDescription
typestringYesnone only collects the posts and sends the webhook, text replies with text, ai writes a reply from prompt.
textstringWhen type is textThe reply, up to 500 characters. {name} becomes the author's username and {Hi|Hello} picks one at random.
promptstringWhen type is aiHow the AI writes the reply, up to 2,000 characters. The AI uses your AI setting, your own key or Repliz tokens, and answers in the language of the post.
knowledgeIdsstring[]NoUp to 5 IDs from Get Knowledge the AI reads when type is ai.
approvalstringUnless type is nonereview keeps each reply as a draft until you send it with Send Keyword Watch Reply, auto sends it by itself and needs criteria. There is no default.

How It Works ​

  1. Search. The account searches Threads with its own token. It looks for the newest posts with every word of the keyword (in the text, image description, article, or topic tag; with TAG mode, the topic tag), published after the account was set, every 5 to 60 minutes: more often while the keyword is busy, less while it is quiet. Its own posts are skipped.
  2. Keep. Posts with a word of excludes are skipped. With criteria, the AI of your AI setting reads each new post and keeps only posts whose main subject fits (sharing a word is not enough), with a short reason saying what the post is about; its tokens are counted in token and in the history of Setting AI. Without criteria, every post with the keyword is kept. Each kept post sends the keyword_match webhook event, before any reply. A post is read once per watch, even when two accounts find it.
  3. Reply. The account does what reply says. With review, the reply waits as a draft (AI drafts are written right away) for up to 90 days. With auto, it is queued and sent by itself.

The posts are listed in Get Keyword Watch Post.

Limits ​

Replying to strangers can look like spam to Threads, so every account is paced, however many watches use it:

LimitValue
Replies10 per hour and 50 per day per account, 3 to 10 minutes apart
Same personNot replied to again by the same account for 7 days (automatic replies)
Searches1,500 per day per account, together with Search Content Threads
Found posts100 per day per watch
Posts read by the AI2,000 per day per account, to protect your AI balance
  • Daily limits reset at midnight UTC.
  • A reply counts when it is queued. If it is then cancelled, skipped, or fails before it is sent, its place is given back.
  • An automatic reply that can't get a slot within an hour, or that hits a limit, is skipped with a skipReason. You can still send it later.
  • When Threads answers with a rate limit or a spam warning, the account waits 15 minutes, doubling up to 6 hours.
  • An account used by many active watches searches each of them less often, about once every 1.1 minutes × the number of watches (for example every 56 minutes with 50 watches), so its searches last the whole day instead of running out before it ends.
  • An account at a search limit waits with heldUntil and heldReason and continues by itself.

Replies that look human

Use ai, or a text with variations such as {Hi|Hello} {name}!, and start with review until you trust the criteria.

Plan limit

1 keyword watch on Free, 5 on Standard, 20 on Premium, 50 on Gold, paused ones included. Above it, the request fails with 403. The API itself needs Gold.

Example Request ​

bash
curl -X POST "https://api.repliz.com/public/watcher" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "keyword": "rekomendasi kopi",
    "filter": {
      "mode": "KEYWORD",
      "type": "",
      "username": "",
      "isIncludeReplies": false
    },
    "excludes": [
      "lowongan",
      "giveaway"
    ],
    "criteria": "Orang yang minta rekomendasi kedai kopi di Jakarta, bukan iklan atau berita.",
    "accountId": "680affa5ce12f2f72916f67e",
    "reply": {
      "type": "ai",
      "prompt": "Balas sebagai tim Kopi Kita: singkat, ramah, rekomendasikan cabang Kemang.",
      "knowledgeIds": [
        "6911b2c3d4e5f6a7b8c9d0e1"
      ],
      "approval": "review"
    }
  }'
javascript
import axios from 'axios';

const response = await axios.post(
  'https://api.repliz.com/public/watcher',
  {
    keyword: 'rekomendasi kopi',
    filter: {
      mode: 'KEYWORD',
      type: '',
      username: '',
      isIncludeReplies: false,
    },
    excludes: ['lowongan', 'giveaway'],
    criteria: 'Orang yang minta rekomendasi kedai kopi di Jakarta, bukan iklan atau berita.',
    accountId: '680affa5ce12f2f72916f67e',
    reply: {
      type: 'ai',
      prompt: 'Balas sebagai tim Kopi Kita: singkat, ramah, rekomendasikan cabang Kemang.',
      knowledgeIds: ['6911b2c3d4e5f6a7b8c9d0e1'],
      approval: 'review',
    },
  },
  {
    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/watcher', {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    keyword: 'rekomendasi kopi',
    filter: {
      mode: 'KEYWORD',
      type: '',
      username: '',
      isIncludeReplies: false,
    },
    excludes: ['lowongan', 'giveaway'],
    criteria: 'Orang yang minta rekomendasi kedai kopi di Jakarta, bukan iklan atau berita.',
    accountId: '680affa5ce12f2f72916f67e',
    reply: {
      type: 'ai',
      prompt: 'Balas sebagai tim Kopi Kita: singkat, ramah, rekomendasikan cabang Kemang.',
      knowledgeIds: ['6911b2c3d4e5f6a7b8c9d0e1'],
      approval: 'review',
    },
  }),
});

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

Response ​

json
{
  "watcherId": "6913a5c2e4b0a1f2c3d4e5f6"
}
json
{
  "code": 400,
  "message": "set up AI in Setting AI first to filter posts with criteria"
}
json
{
  "code": 403,
  "message": "keyword watch limit reached for your plan"
}
json
{
  "code": 404,
  "message": "account not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}

Other 400 messages: approval auto needs criteria, use review or fill in criteria, keyword watch only works with Threads accounts, approval must be auto or review, and the validation message of a missing field.