Skip to content

Webhooks

Yousef Ghadiri edited this page Jul 3, 2026 · 4 revisions

Webhooks

Knightwatch can POST process and system events to one or more HTTP endpoints. Useful for integrating with external orchestration, alerting, or logging pipelines.

Usage

Enable webhooks with --with-webhook and provide one or more targets via --webhook:

knightwatch --pid <PID> --with-webhook --webhook https://example.com/hook --webhook https://other.com/hook

Webhook URLs can also be stored in persistent config and are merged with any --webhook flags at runtime (deduplicated). See Persistent Configuration.

Payload Format

{
  "version": "1.0.0",
  "event": "process.children_exited",
  "timestamp": "2025-01-01T00:00:00Z",
  "data": {
    "pids": [5678, 5679]
  }
}

Failed deliveries are retried up to 3 times with exponential backoff.

Events

Webhooks deliver the same set of events, with the same payload shapes, as the SSE streams on the API. See Events for the full list of process, system resources, Docker, and systemd events, along with their data fields.

Clone this wiki locally