Based on AgentRun release · Synced .
Webhooks
One URL hears of your runs without anyone watching the page. PUT /v2/settings/webhook with {url} sets it: an http
or https address, with no user or password in it, on a public host: a loopback or private-network address is refused
unless the operator allows it (AGENTRUN_WEBHOOK_PRIVATE_TARGETS=1, below; start-time switches). Two kinds of message are POSTed to it about runs: run.needs_input when a run comes to
need its person (input_required: a question, a call held for approval, a pause at its cap, an ask for its person in
its browser, desktop or phone, or a stopped turn) and run.ended when it ends
(completed, failed or cancelled, once the run's end is written). A schedule whose firing fails sends a third,
trigger.failed; a server with no triggers never sends one.
The server follows the store's run-change feed: each run that reaches its end, or that its runner lets go waiting on a
person, is told once, in order, whichever runner wrote it, so a receiver that reads the run back on its message
(GET /v2/runs/{id}) reads it as the message says. The end's time is the store's, so the row's ended_at and the
message's webhook-id name one time. A wait's webhook-id comes from its ask (a question's, an approval's call, a
pause at the cap, a hand-over), so one ask sends one run.needs_input, however often the run is read and after its
answer too. Everything the webhook keeps is in the store: its messages, their tries, and which
end and which wait of each run it queued, written with each message in one transaction. While the store refuses that
write (a full disk, a busy store), nothing is sent and the log says so (condition=outbox_unwritable); the server tells
the notice again on its next read. A server that starts queues any end of the last day that the store holds and the
webhook has not, under the same webhook-id (one lost to a kill, or to a crash of the machine), and any wait a run
stands at that it has not told (one the run came to while no server was up), under its one webhook-id. An end before
the webhook was set is never sent.
{ "type": "run.needs_input", "timestamp": "2026-11-01T12:00:00.000Z",
"data": { "run_id": "…", "agent_id": "triage", "agent_name": "Triage", "status": "input_required", "title": "…",
"url": "https://agents.example.com/#/runs/…", "pending": { "kind": "question" } } }
A message is thin: ids, the agent's name, the status, the title and a link to the run on the page; never a tool's
arguments, an output or an input, which the API reads (GET /v2/runs/{id}). agent_name is the agent's name as the
message is built (a rename after it is not sent again), or its id when it has none. The title is the run's own, as the store holds it: a trigger's
run is titled from its trigger, <Source> <name> and the event when its source names one ("Webhook reviews:
pull_request opened"), never from its input; a workflow run's from its agent's name and its input; any other run's
from its input. pending.kind is question (an ask_person),
approval (a tool call that waits for a person's approval), stopped (a stopped turn), budget (a run paused at its
cap) or browser (the agent asked for the owner in its browser). An agent's ask for the owner on its desktop or phone
(the run's pending.kind computer) is told as question.
Messages are signed by the Standard Webhooks spec, so a receiver verifies them
with any of its libraries: webhook-id (the same on every try of a message, so it is the receiver's idempotency key),
webhook-timestamp (Unix seconds) and webhook-signature: v1,<base64 HMAC-SHA256 of "{id}.{timestamp}.{body}"> under
the secret's bytes. A receiver checks the signature against the raw body and refuses a timestamp more than 5 minutes
from its clock, so a replay does not pass. The first PUT makes the secret, whsec_ and 32 random bytes in base64,
and answers 201 with it, once; GET /v2/settings/webhook never shows it. It is kept like a tool key:
sealed under the server's seal key in the store, and a replaced or removed one is kept sealed too, so a run that echoes
it is still cut. A PUT that changes the URL makes a new secret and shows it once, as the first does; one that keeps the
URL keeps it. GET and the log show the URL's origin and its last four characters, never the whole URL (a chat
service's incoming-hook URL is a credential itself). The URL is refused when it is on a private network or this machine,
by address or by any address its name resolves to, and each try resolves the name again and dials the address it
checked; an operator who sends to an internal receiver sets AGENTRUN_WEBHOOK_PRIVATE_TARGETS=1 where the server starts
and restarts it, which the refusal says, at the PUT and in a try's log entry. A DIR/webhook.json an earlier build left is not read: the
server says so at its start (condition=webhook_left_over), and a PUT sets the webhook again. A new secret for the
same URL is POST /v2/settings/webhook/secret (Settings → Webhook → Rotate secret in the console), from the owner's
signed-in session alone, as every secret write is: it answers the new secret once, as signing_secret, and retires the
old one at once, so every try after it is signed with the new one, a message queued before it included. A 404 says no
webhook is set. A secret that no longer opens under the server's key (sealed under another) is replaced, and shown
once, by a rotation or the next PUT. The URL and its secret go live together: a PUT whose write the store
refuses leaves the webhook as it was, and the secret it made is never used.
A try that is not answered 2xx within 15 s fails; a redirect is not followed. A failed message is tried again on the
spec's schedule, with jitter: after about 5 s, 5 min, 30 min, 2 h, 5 h and 10 h, then logged as failed
(event=webhook condition=delivery_failed). Each message goes on its own tries, so two queued close together can
arrive in either order: a receiver orders them by webhook-timestamp, or reads the run (GET /v2/runs/{id}). A
410 Gone turns the webhook off (disabled in GET, and the log says why) until a PUT sets it again. Pending messages are kept in the store, so the next server goes on with them after a
restart; a message can then come twice, under the same webhook-id. GET /v2/settings/webhook/deliveries
lists the last 50 attempts (webhook_id, type, status code, latency, error, when, and the next try's time), and
POST /v2/settings/webhook/deliveries/{webhook_id}/redeliver sends one of those messages again, once, under the same
webhook-id. POST /v2/settings/webhook/test sends a webhook.test message once and answers how it went. A webhook a
410 turned off sends nothing, a test or a redelivery included (409 webhook_off), until a PUT sets it again.
DELETE /v2/settings/webhook removes the webhook and drops its pending messages.
Post to Slack
Slack shows a message, not the webhook's signed JSON, so the server can post to a Slack channel itself. In Slack, add an
incoming webhook to the channel (an app with Incoming Webhooks turned on), then paste its URL in the console under
Settings → Slack, or PUT /v2/settings/slack with {"url": "https://hooks.slack.com/services/..."} from the owner's
signed-in session. The URL must be https://hooks.slack.com/services/..., with no port, query or user.
The URL is the credential: anyone who has it can post to the channel. So saving it is a secret write (the API token is
refused 403, with details.console_url opening Settings → Slack, never the URL), it is sealed under the server's seal key like a tool key, and no answer, log line or
delivery shows more than its last four characters. A replaced or removed URL stays sealed in the store, so a run that
echoes it, or its token, is still cut.
Each event posts one message (Block Kit, with text for notifications):
| Event | The message |
|---|---|
run.ended |
The agent (its agent_name: its name, else its id), the status in a word (completed, failed, was cancelled), the run's title linked to the run in the console. |
run.needs_input |
The same, with "needs you" and what the run waits on: a question, an approval, a paused cap, a hand-over or a stopped turn. |
trigger.failed |
The trigger's name, linked to it, and the error's code and message; and whether it turned itself off. |
{ "text": "Lead triage: run completed: Qualify ACME",
"blocks": [
{ "type": "section", "text": { "type": "mrkdwn", "text": "*Lead triage* · run completed\n<https://agents.example.com/#/runs/…|Qualify ACME>" } },
{ "type": "context", "elements": [{ "type": "mrkdwn", "text": "AgentRun · run.ended · run `…`" }] } ] }
A message never carries a run's input, its output or a tool's arguments, as the webhook's never does: open the run
from the link to read them. Every string in it (an agent's or a trigger's name, a run's title, an error) is cut of the
secrets the server holds before it is saved or posted: a key typed into a name reads [redacted]. Every event is on by default. PUT /v2/settings/slack with
{"events": {"run.needs_input": false}} turns one off; a body with events alone is no secret write.
Delivery is the webhook's: the same outbox in the store, retries on the same schedule, one message per run's end or
wait, deliveries at GET /v2/settings/slack/deliveries, a message posted again with
POST /v2/settings/slack/deliveries/{webhook_id}/redeliver, and a test message with POST /v2/settings/slack/test.
Slack answers 200 ok. A 404 or 410 (no_service, channel_not_found, channel_is_archived) turns Slack off
(disabled in GET, with Slack's word) until a URL is saved again; a test or a redelivery is then 409 slack_off.
DELETE /v2/settings/slack removes the URL and drops pending messages.
