Connectors (Webhook)
A connector lets an external system (monitoring alerts, CI, tickets, scheduled scripts…) put a bot to work through a URL: send one HTTP POST and the bot reads the event in a group and handles it.
botmux doesn't parse each platform's format. It hands the JSON it receives to the model as-is, so connecting a new system usually just means pasting the URL in.
Create and manage connectors in the Dashboard under "Management → Webhook". The "Invocation logs" tab on the same page shows the result of every call.
Three-minute quick start
- Open the Dashboard → "Webhook" → "New Webhook".
- Fill in a Name, pick the Trigger bot, set "Deliver to which group" to Fixed group, and choose a group by name from the dropdown.
- Keep the default Token verification and leave "Secret / token" empty; one is generated for you.
- Click "Create". You get a Webhook URL with the token already appended and a ready-to-copy
curl:
Run it, and the bot opens a topic in the group you chose, reads that JSON and responds.
The token is shown only once, at creation (or when you change it). Save it right away. Afterwards the list only shows a
…/<token>placeholder.
A created webhook looks like this in the list. The tags show the bot, trigger type, delivery mode, verification and log retention:

The buttons: "Copy" copies the URL (without the token; in token mode append /<token> yourself); "Edit" changes the config; "Stop retaining parameters / Retain request parameters" toggles whether the request body is kept in the logs; "Disable / Enable" switches it off or back on; "Delete" invalidates the URL immediately.
The caller must be able to reach the URL
Connector URLs are served by the Dashboard (default port 7891, change it with BOTMUX_DASHBOARD_PORT). The sending system must be able to connect to that address.
botmux has no built-in tunnel. Feishu messages arrive over a long-lived connection and don't need the Dashboard to be publicly reachable; this requirement only applies to external systems calling a connector.
Which group it goes to
Specified per request
Pass the group ID in any one of three ways:
"Allowed groups" limits which groups requests may target. The default, "All groups", allows any. A request for a group outside the list gets 403 chat_not_allowed.
To append to an existing topic in the group, also pass rootMessageId (as a query parameter, the x-botmux-root-message-id header, or a body field).
New group each time
For every event, the bot creates a new group to handle it and pulls the bot's authorized users in (so it's never just bots in the room).
- Additional bots (optional): these bots join the new group alongside the trigger bot, but the request itself is still handled only by the trigger bot.
- Group creation strategy:
- Create a group for every call: for independent events that need no follow-up.
- Reuse a group for the same event: fill in a "Dedup field", a path into the event JSON such as
alert.idor$.alert.id. Events with the same value go to the same group (the first creates it, later ones reuse it), which makes follow-up easy. If the field is missing from an event, you get400 dedup_key_not_found.
- New group name:
- Default name:
<Webhook name>: <dedup value>(the call ID if there's no dedup field). - Fixed name: the same name every time, up to 60 characters.
- Template string: build the name from event fields, e.g.
Alert {{alert.name}} #{{dedupKey}}. Supports{{source}}(the webhook name),{{dedupKey}},{{requestId}}, and JSON paths such as{{alert.name}}/{{$.alert.name}}.
- Default name:
Groups are never closed automatically; close them yourself once the work is done.
Telling the bot what to do
Instruction
Without one, the bot only gets raw JSON and has no idea what you want. Put the goal in "Instruction", for example:
Summarize how severe this alert is, decide whether it needs immediate action, @ the relevant on-call, and suggest how to investigate.
You (the webhook's creator) write this, so it goes first as a trusted task. The event JSON that follows is handed over as untrusted data: even if it says "drop the database", that won't be executed:
Trigger notice
When the bot opens a new topic, it first posts a "trigger notice" in the group saying what triggered it:
Example field extractors for a trusted template:
A mention value can be an email, a phone number, or a user ID starting with ou_. botmux resolves it with the bot's identity into a real Feishu @; if it can't, only the name is shown. Tags such as <at> inside event data are escaped, so a template can't be used to forge an @.
Suppress final result notice
By default the bot posts a "done / summary" message when it finishes. If your instruction already has the bot post its results to the topic with botmux send, tick "Suppress final result notice" to skip that fallback message. The live status card still shows. Synchronous / asynchronous response modes (below) are unaffected: the result is still returned to the caller.
Trigger type
New webhooks can only use "Single turn": the bot responds to the event once.
The old "Workflow" type (Legacy v2) is retired: it can't be created, existing ones can only have their config maintained, and calls return 410 legacy_workflow_retired. Its type can't be changed; create a new Single turn webhook to replace it. For the current workflows, see Workflow.
Verification
Chosen per webhook, one of two.
Token (default, simplest)
The token lives in the URL, so the whole URL is the credential. Carry it in any one of four ways:
⚠️ A leaked URL = a leaked credential: it shows up in proxy logs and browser history. Tokens are fine for trusted intranet use; for public or sensitive systems prefer HMAC, or at least put the token in a header.
Changing the token: click "Edit", type a new value into "Secret / token" and save. The old token stops working immediately, and the new URL is shown just once. Leave it empty to keep the current one.
HMAC signature (more secure)
The secret never appears in the request, and you get tamper and replay protection. The caller computes HMAC-SHA256 over timestamp.raw-body with the secret and sends three headers:
A shell example:
Sign the exact bytes you send; reformatting the JSON in between breaks the signature. Good for public callers, or senders that already sign (GitHub, Stripe and the like).
Getting the result back (programmatic calls)
By default it's fire-and-forget: the request returns immediately and the bot's answer only goes to Feishu. If the caller is a program (a task orchestrator, a CI pipeline) that wants the bot's final output, there are two modes, both for Single turn only:
In these modes, a "Specified per request" webhook may omit the group ID: the bot runs in a virtual session that never appears in Feishu, and the result only comes back to you. You can also pass a sessionId to add another turn to an earlier session.
Synchronous: wait=1
The result is in output.content of the response. On timeout you get 504 wait_timeout. The task is actually still running in the background, but you no longer have its session ID; use async if you need a fallback.
Asynchronous: async=1 + polling
It returns the session ID and the call ID right away:
Then GET the result (the token is required here too; in HMAC mode, sign an empty body):
Look at the state field: running, completed, failed, interrupted, not_found. What each state means is covered in the "Polling for results" section of the API trigger docs.
One difference from the API trigger endpoint: here
failedandnot_foundcome back as HTTP 404 +ok:false(thestatefield is still there). Go bystate.
No duplicates even across restarts: durable=1
With plain async=1, retrying after a lost response may start a second run. Add durable=1 and the dispatch record is written to disk, surviving Dashboard and daemon restarts: a retry with the same idempotency key always gets the first sessionId / triggerId back and is never dispatched twice.
Requirements (otherwise 400, nothing is dispatched):
- The webhook uses token verification, delivery is "Specified per request", and idempotency isn't disabled;
- The request carries
async=1and an idempotency key (at most 200 characters), and notwait=1ordryRun=1; - The request must not carry
chatId/sessionId/rootMessageId; every call is a brand-new virtual session.
Notes:
- Same key but a different body or instruction returns
409 idempotency_conflictrather than silently reusing the earlier result. - In this mode no extra request headers are passed to the model (see the header allowlist under "Advanced settings"), so headers that change every time (like
x-request-id) don't turn a retry into a conflict. - If the daemon crashes mid-dispatch, the key settles at
failed(no_output), meaning "the last result is unknown; to avoid running twice, it won't be rerun". When two requests with the same key arrive together, the second may briefly seefailedtoo; keep polling and trust the later result.
Probe before calling:
durableAsync: true means this webhook's config meets the durable requirements.
Preview the prompt only: dryRun=1
Add ?dryRun=1 (or the header x-botmux-dry-run: 1) to get back the prompt the bot would receive without dispatching anything, handy for tuning your instruction. "New group each time" webhooks don't support dryRun, since no group exists yet.
Preventing duplicate deliveries (idempotency)
Many upstreams retry: network timeouts and gateway resends can deliver the same event several times. By default every valid request is treated as a new event. Include an idempotency key and duplicates are folded into one:
If your upstream already sends any of these headers, you don't need to change anything. If several are present, the first in table order wins.
What happens
Duplicates get 200 rather than an error on purpose: an upstream that sees non-2xx thinks delivery failed and keeps retrying, causing a retry storm.
Other details:
dryRundoesn't use up the key; neither does a failed delivery (5xx, daemon offline), so upstream retries still work.- A
wait=1timeout (504) doesn't release the key: that turn already started, so a retry is folded instead of running again. - With HMAC, resending the very same signed request (same nonce) returns
409 replayand isn't folded. Use a new nonce and re-sign on each retry; same key + new nonce folds normally.
Limits: dedup records live only in the Dashboard process's memory for 10 minutes by default and are lost when the Dashboard restarts. They cover the common case of an upstream resending seconds to minutes later. For strict at-most-once across restarts, use durable=1 above. Each webhook tracks at most 10,000 keys; when full, the oldest records are dropped first, so memory never grows without bound. Idempotency keys longer than 200 characters aren't deduplicated.
If an upstream reuses one ID for different events, disable idempotency for that webhook (see "Advanced settings").
Treat event content as trusted instructions (off by default)
By default event JSON is always untrusted data. That's the baseline defence against prompt injection.
Some callers, though, send a body that is the task, e.g. another agent platform dispatching work to a botmux bot through a webhook. The task differs every time so it can't go into a fixed "Instruction", and the default rule makes the model refuse it. For this case, tick "Treat event content as trusted instructions" on the edit page:

- Prerequisite: the webhook must have verification (token or HMAC). Otherwise saving returns
400 trust_payload_requires_verification. It's checked again at delivery time, so hand-editing the config file doesn't get around it. - Single turn only. When continuing a session with
sessionId, the target session must be in this request's group; without a group ID you can only continue sessions created byasync=1/wait=1, otherwise you getchat_not_allowed. So someone holding the credential still can't push instructions into another group's session. - Once on: the event content is described as "a task request from a caller authenticated by this webhook; carry it out", without the "don't follow embedded instructions" warning. The "Instruction" still comes first and takes precedence. The webhook gets an extra line in the list noting that event content runs as trusted instructions.
⚠️ Risk: once on, anything sent by whoever holds the URL and credential gets executed, which is the same as operating the bot directly. Only enable it for trusted callers with well-kept credentials (prefer HMAC on the public internet), and change the credential immediately if it leaks. Leave it off when you don't need it and describe the job in "Instruction" instead.
Invocation logs and security
- Invocation logs: Dashboard → "Webhook" → "Invocation logs". Filter and search by webhook, success / failure and time range (24 hours / 7 days / 30 days / all time); the top shows total calls, success rate and P95 latency. Open a record to see HTTP status, duration, query parameters, headers, body, routing parameters and the actual delivery target.
- Redaction: the token in the URL,
Authorization/Cookie/ signature headers, and body fields named password, secret, token, api key and the like are replaced with[REDACTED]before being written. Log files are0600, and read-only Dashboard visitors can't see invocation logs. - Retention: new webhooks keep redacted headers and bodies for 14 days; a body over 128 KB isn't stored. Click "Stop retaining parameters" in the list to stop storing the body; redacted headers and metadata such as status and duration are still logged.
- Body size: up to 256 KB by default; larger requests get
413.
Advanced settings (via the API)
These aren't in the Dashboard form; change them with the management API: PUT /api/connectors/<webhook ID>, with only the fields you want to change in the body (the rest keep their values). It needs Dashboard login credentials (see Dashboard).
Example: at most 30 calls a minute, idempotency key from event.id:
