Skip to content
ViceVox
MenuClose
DocumentationMonitor mentions

How to monitor mentions of your brand and reply

Last updated

Get an event when someone mentions your brand's account, and reply to the ones that need an answer. An alert checks the account on a schedule and records each new mention once. Your script or agent waits for the events with a long poll.

You need an API key with inbox_read (and content_publish to reply), your workspace id and the id of an active account.

Create an alert for mentions

POST/v1/workspaces/{workspace_id}/alerts

Name the accounts and the events. mention is a post that tags the account, reply is a reply to the account, and quote is a quote of one of its posts. interval_minutes is 10, 30, 60 or 180.

Request
curl https://api.vicevox.com/v1/workspaces/$WORKSPACE_ID/alerts \
  -H "Authorization: Bearer $VICEVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_ids": ["0199a1b2-..."],
    "events": ["mention", "reply", "quote"],
    "interval_minutes": 30
  }'
201 Created (trimmed)
{
  "id": "0199e5f6-...",
  "account_ids": ["0199a1b2-..."],
  "events": ["mention", "reply", "quote"],
  "webhook": false,
  "interval_minutes": 30,
  "status": "active",
  "pause_reason": null,
  "next_check_at": "2026-11-21T09:30:00Z"
}

Save id as $ALERT_ID. The first check records what the account already has and gives no events. After it, each check records only what is new.

Accounts on X, Instagram, Facebook, TikTok, Threads, Bluesky, Reddit, YouTube, Pinterest, Mastodon, Twitch, GitHub, DEV Community and Hashnode can send mention events. LinkedIn, Telegram and Hacker News cannot. Events per platform lists all events.

Wait for new mentions

GET/v1/workspaces/{workspace_id}/alert-events

Send after and wait. When there are new events, the answer comes at once. Else ViceVox holds the request up to wait seconds (at most 60) for the next one. Leave out after on the first request.

Request
curl -H "Authorization: Bearer $VICEVOX_API_KEY" \
  "https://api.vicevox.com/v1/workspaces/$WORKSPACE_ID/alert-events?alert_id=$ALERT_ID&after=$LAST_EVENT_ID&wait=60"
200 OK
{
  "events": [
    {
      "id": "0199c7d8-...",
      "alert_id": "0199e5f6-...",
      "account_id": "0199a1b2-...",
      "platform": "x",
      "kind": "mention",
      "actor": "jamie_codes",
      "actor_id": "1234567890",
      "text": "@acme_demo is dark mode coming to the app?",
      "url": "https://x.com/jamie_codes/status/1851...",
      "occurred_at": "2026-11-21T09:12:00Z",
      "created_at": "2026-11-21T09:30:04Z"
    }
  ],
  "next_cursor": null,
  "last_event_id": "0199c7d8-..."
}

Send last_event_id as after in the next request. Events come in the order ViceVox recorded them, so you get each event once and miss none. Keep last_event_id when your script stops, and send it when it starts again. ViceVox keeps events for 90 days.

JavaScript

JavaScript
// mentions.mjs: waits for new mentions and prints each one once.
const api = "https://api.vicevox.com/v1";
const headers = { Authorization: `Bearer ${process.env.VICEVOX_API_KEY}` };
const workspaceId = process.env.WORKSPACE_ID;
const alertId = process.env.ALERT_ID;
let after = process.env.LAST_EVENT_ID ?? "";

for (;;) {
  const query = new URLSearchParams({ alert_id: alertId, wait: "60" });
  if (after) query.set("after", after);
  const res = await fetch(`${api}/workspaces/${workspaceId}/alert-events?${query}`, { headers });
  if (res.status === 429 || res.status >= 500) {
    const seconds = Number(res.headers.get("retry-after") ?? 10);
    await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
    continue;
  }
  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
  const page = await res.json();
  for (const event of page.events) {
    console.log(event.kind, event.url ?? "(no url)", event.text);
  }
  after = page.last_event_id ?? after;
}

Python

Python
# mentions.py: waits for new mentions and prints each one once.
import os
import time
import requests

api = "https://api.vicevox.com/v1"
headers = {"Authorization": f"Bearer {os.environ['VICEVOX_API_KEY']}"}
workspace_id = os.environ["WORKSPACE_ID"]
alert_id = os.environ["ALERT_ID"]
after = os.environ.get("LAST_EVENT_ID")

while True:
    params = {"alert_id": alert_id, "wait": 60}
    if after:
        params["after"] = after
    resp = requests.get(
        f"{api}/workspaces/{workspace_id}/alert-events",
        headers=headers,
        params=params,
        timeout=75,
    )
    if resp.status_code == 429 or resp.status_code >= 500:
        time.sleep(int(resp.headers.get("Retry-After", "10")))
        continue
    resp.raise_for_status()
    page = resp.json()
    for event in page["events"]:
        print(event["kind"], event["url"] or "(no url)", event["text"])
    after = page["last_event_id"] or after

actor, text and url are what the page shows, or null. actor_id is the person's id on the platform, which stays when they change their handle.

With MCP

An agent creates the alert with create_alert and calls wait_for_alert_events in a loop. Each call gives the events and the last_event_id for the next call. wait is 30 seconds by default, at most 60.

tools/call params
{
  "name": "wait_for_alert_events",
  "arguments": {
    "workspace_id": "0199...",
    "alert_id": "0199e5f6-...",
    "after": "0199c7d8-...",
    "wait": 60
  }
}

A client can also subscribe to the alert's events as a resource. See Alerts over MCP. Alerts can also go to your webhooks.

An alert sees the posts that tag the account. To find posts that name the brand without a tag, run search. query is the text you would type into the platform's search box. On X, post results come from the Latest tab.

Request
curl https://api.vicevox.com/v1/accounts/$ACCOUNT_ID/actions \
  -H "Authorization: Bearer $VICEVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "search", "query": "acme dark mode", "kind": "posts", "limit": 50, "wait": 60 }'

The result is posts, with url, id, author_handle, text and published_at for each post. A search has no cursor and no time filter, so keep the URLs you have seen. To read the notifications once, without an alert, run read_notifications.

Usage

A check uses usage when it succeeds. An account in more than one alert is checked once, at the shortest interval. A longer interval uses less. Reading the events uses none. A search uses usage when it succeeds.

Note: When the usage of the plan is used up, the alert pauses with pause_reason: usage_limit. With subscription status none or canceled, it pauses with subscription_required. It resumes by itself when usage is back or the organization subscribes.

Reply to a mention

Reply with the event's url as target. Make the Idempotency-Key from the event's id, so a second run cannot post a second reply. When url is null, the page showed no link, so there is no target for a reply. How to read and reply to comments covers which platforms let a reply answer one comment.

Reply to a mention
curl https://api.vicevox.com/v1/accounts/$ACCOUNT_ID/actions \
  -H "Authorization: Bearer $VICEVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-0199c7d8-..." \
  -d '{
    "type": "reply",
    "target": "https://x.com/jamie_codes/status/1851...",
    "text": "It is in the app today: Settings, Appearance.",
    "wait": 60
  }'

Common errors

422 unsupported
An account does not offer an event. supported lists the events that all the named accounts offer.
422 limit_reached
A workspace holds at most 100 alerts.
422 invalid_input
cursor cannot go with after or wait.
404 on the long poll
The after event is gone with its alert or after 90 days. Leave out after to start again from the oldest event.
No events
The account is not active, so ViceVox does not check it. Seehow to check and fix a signed-out account.

See also

To run this on your own accounts, create a ViceVox account, then add an account and an API key.