Skip to main content

Webhooks

BossMode webhooks go two directions. Inbound events come from trusted partners — the primary example is AvatarCzar sending confidence updates when a persona’s read on the market changes. Outbound events go from BossMode to whatever URL you configure — Slack, a warehouse, your own service — when directives execute, packs install, revenue is recorded, or the guardian kill engages. Both directions are HMAC-SHA256 signed, timestamp-guarded to reject replays older than 5 minutes, and verified in constant time. Inbound endpoints resolve the sending customer from the payload’s identifier (not from the body’s customerId field) to block cross-tenant forgery. Outbound deliveries are at-least-once with exponential backoff — design handlers to be idempotent.

Inbound webhooks — AvatarCzar confidence updates

BossMode accepts inbound confidence update events from AvatarCzar at:

Signature verification

Every inbound request from AvatarCzar is signed with HMAC-SHA256. The implementation is in lib/avatarczar-inbound.ts. The signature is delivered in the x-avatarczar-signature request header in the format:
To verify:
Verification uses a constant-time comparison (crypto.timingSafeEqual) to prevent timing attacks.

Payload shape

The inbound payload is validated against the avatarCzarConfidenceUpdateSchema from lib/avatarczar-inbound.ts:

Rate limit

/api/pro/avatarczar/induction — 60 requests per 60 seconds.

Outbound webhooks — operator destinations

Configure outbound webhook destinations to receive BossMode events at your own endpoints.

Configuration endpoint

Rate limit: 5 requests per 60 seconds.

Registering a destination

URLs are SSRF-validated before the config saves — private IPs, localhost, 169.254.0.0/16 metadata hosts, and non-HTTPS schemes are rejected.

Event types

Request format

Verifying

Retry policy

  • At-least-once delivery. Design handlers to be idempotent.
  • Up to 5 attempts with exponential backoff (1s → 10s → 60s → 10m → 1h).
  • Response 2xx = delivered. Any other status = retry. Response 410 Gone = permanent failure; retries stop.

Security

Outbound webhooks from BossMode are signed with HMAC-SHA256, using the same signing approach as AvatarCzar inbound events. Verify the X-BossMode-Signature header on your receiving endpoint.