Skip to main content
Webhooks let external services trigger ollim-bot background forks over HTTP. A CI pipeline can notify the bot about a failed build, a monitoring tool can report downtime, or any service that speaks HTTP can send structured data for the agent to act on. Webhook specs are markdown files with YAML frontmatter — the same format as routines and reminders. The agent can create and manage them conversationally through file access.

Prerequisites

  • ollim-bot running (quickstart)
  • Two environment variables set in .env:
If WEBHOOK_PORT is set but WEBHOOK_SECRET is missing, the server refuses to start.

Setup

1

Set environment variables

Add both variables to your .env file:
2

Create the webhooks directory

3

Write a webhook spec

Create a markdown file in ~/.ollim-bot/webhooks/. The filename is arbitrary — the id field in the frontmatter determines the URL path.
~/.ollim-bot/webhooks/github-ci.md
4

Restart the bot

The webhook server starts automatically when the bot launches. You’ll see in the logs:
5

Send a test request

A successful request returns 202 Accepted with {"status": "accepted"}.

Spec file format

Each webhook spec is a .md file in ~/.ollim-bot/webhooks/ with YAML frontmatter and a markdown body.

Frontmatter fields

The isolated, model, thinking, allow-ping, and update-main-session fields have the same semantics as background fork configuration.

Markdown body

The body is a prompt template — instructions for what the agent should do with the incoming data. The validated JSON payload is passed to the agent separately (as a fenced data block in the prompt), so you don’t need placeholders. Just describe the task and reference field names naturally.

Fields schema

The fields value is a set of validation rules using JSON Schema. It defines which fields the webhook accepts, their types, and any constraints.
  • Use enum over free string wherever values are known
  • Use integer / boolean over string for non-text data
  • Always set maxLength on string fields (default 500 if omitted)
  • Always set additionalProperties: false

How requests are processed

When an HTTP request hits /hook/{id}, the bot authenticates it, validates the payload against the spec’s field rules, and fires a background fork with the validated data. The caller receives 202 Accepted immediately — the bot processes the webhook asynchronously. Invalid requests are rejected with descriptive errors:
  1. Auth check — verifies the secret token in the request header.
  2. Spec lookup — matches the URL path to a spec’s id field.
  3. JSON parse — reads the request body as JSON.
  4. Schema validation — validates the payload against the spec’s fields rules.
  5. Prompt construction — the bot builds a prompt combining the task instructions (markdown body) with the validated JSON payload as a fenced data block, keeping webhook data clearly separated from instructions.
  6. 202 Accepted — response sent immediately.
  7. Subagent validation — if the spec references a subagent, the bot verifies it exists. Unknown subagents skip dispatch entirely.
  8. Injection screening — free-form text fields are checked for attempts to trick the bot (30-second timeout — if screening fails, the webhook proceeds). Flagged payloads are skipped and logged.
  9. Skill validation — if the spec references skills, the bot verifies each one exists in ~/.ollim-bot/skills/. Missing skills skip dispatch entirely.
  10. Dispatch — a background fork runs with the spec’s configuration.
Webhooks accept external input, so four layers of defense prevent outside data from tricking the bot:
If the injection screening check itself fails (e.g. a network error), the webhook is processed normally rather than blocked. This prevents screening outages from blocking legitimate webhooks.

Troubleshooting

Check that both WEBHOOK_PORT and WEBHOOK_SECRET are set in your .env file. If only WEBHOOK_PORT is set, the server logs an error and stays disabled.
Verify your Authorization header matches Bearer <WEBHOOK_SECRET> exactly.
Specs are re-read each time a request arrives, so changes take effect immediately without restarting. Verify the file exists in ~/.ollim-bot/webhooks/ and that the id field in the frontmatter matches the path in your URL.
Several things can cause a webhook to be accepted (202) but produce no action:
  • Injection screening flagged a field value. Look for Webhook <slug>: flagged fields [...], skipping dispatch in the logs.
  • Missing skills — the spec references a skill that doesn’t exist in ~/.ollim-bot/skills/. Look for Webhook <slug>: unknown skills [...], skipping.
  • Missing subagent — the spec references a subagent that doesn’t exist. Look for Webhook <slug>: unknown subagent '...', skipping.

Next steps

Background forks

How background forks work — the execution model webhooks use.

Ping budget

How the ping budget controls when forks can notify you.

Google integration

Connect Google services for tasks, calendar, and email access.

Discord tools

The tools available to the agent during webhook-triggered forks.