Skip to main content

Webhooks

Webhooks allow you to receive real-time HTTP POST notifications when events occur in Mission Control. Configure webhook endpoints to integrate with external services, trigger automation, or monitor system activity.

Features

  • Event filtering: Subscribe to specific event types or all events (*)
  • HMAC signature verification: Cryptographically signed payloads using SHA-256
  • Automatic retries: Exponential backoff with jitter (30s, 5m, 30m, 2h, 8h)
  • Circuit breaker: Auto-disable after 5 consecutive failures
  • Delivery history: Track all webhook attempts with status codes and response bodies

List Webhooks

Response

array
Array of webhook configurations with delivery statistics
integer
Webhook ID
string
Webhook name
string
Target URL for webhook deliveries
string
Masked secret (shows only last 4 characters: ••••••abc1)
array
Array of subscribed event types (e.g., ["agent.status_change", "activity.task_created"] or ["*"] for all)
boolean
Whether webhook is active
integer
Number of consecutive delivery failures
boolean
true if circuit breaker is tripped (≥5 failures)
integer
Total delivery attempts
integer
Deliveries with 2xx status code
integer
Deliveries with errors or non-2xx status

Create Webhook

Request Body

string
required
Webhook name for identification
string
required
Target URL (must be valid HTTP/HTTPS endpoint)
array
Event types to subscribe to. Use ["*"] for all events. Defaults to ["*"]
boolean
default:true
Generate HMAC secret for signature verification

Response

The secret field is only shown in full once during creation. Save it securely.
integer
Created webhook ID
string
HMAC secret (64-character hex string). Only shown on creation.
string
Confirmation message

Update Webhook

Request Body

integer
required
Webhook ID to update
string
New webhook name
string
New target URL
array
Updated event subscriptions
boolean
Enable or disable webhook
boolean
Generate a new HMAC secret (returns new secret in response)
boolean
Reset circuit breaker (clears failures and re-enables webhook)

Delete Webhook

Request Body

integer
required
Webhook ID to delete

Get Delivery History

Retrieve webhook delivery logs with status codes, error messages, and response bodies.

Query Parameters

integer
Filter deliveries for a specific webhook
integer
default:50
Maximum deliveries to return (max 200)
integer
default:0
Pagination offset

Response

array
integer
Delivery ID
integer
Parent webhook ID
string
Event type (e.g., agent.status_change, test.ping)
integer
HTTP status code (e.g., 200, 500, null if timeout)
string
Error message if delivery failed
number
Request duration in milliseconds
integer
Retry attempt number (0 = first attempt)
boolean
Whether this is a retry of a previous failed delivery
integer
Unix timestamp
integer
Total delivery count

Retry Failed Delivery

Manually retry a failed webhook delivery.

Request Body

integer
required
ID of the failed delivery to retry

Response

boolean
Whether the retry succeeded
integer
HTTP status code from retry attempt
number
Request duration

Test Webhook

Send a test ping to verify webhook configuration.

Request Body

integer
required
Webhook ID to test

Test Payload Example


Signature Verification

All webhook payloads include an X-MC-Signature header containing an HMAC-SHA256 signature. Always verify this signature before processing webhooks.

Verification Algorithm

  1. Extract the raw request body as a UTF-8 string (do not parse JSON first)
  2. Read the X-MC-Signature header
  3. Compute HMAC-SHA256 of the raw body using your webhook secret
  4. Format as: sha256=<hex-digest>
  5. Compare using constant-time comparison

Node.js Example

Python Example


Retry Logic

Mission Control automatically retries failed webhook deliveries using exponential backoff:
Jitter (±20%) prevents thundering herd when multiple webhooks fail simultaneously.

Circuit Breaker

After 5 consecutive failures (across all retries), the webhook is automatically disabled. To re-enable:
  1. Fix the endpoint issue
  2. Call PUT /api/webhooks with reset_circuit: true

Event Types

Subscribe to specific event types or use * for all events:

Agent Events

  • agent.status_change - Agent status changed (online, offline, busy, error)
  • agent.error - Agent entered error state

Task Events

  • activity.task_created - New task created
  • activity.task_updated - Task fields modified
  • activity.task_deleted - Task deleted
  • activity.task_status_changed - Task status changed

Activity Events

  • activity.<type> - Generic activity (e.g., activity.agent_created, activity.user_login)

Notification Events

  • notification.<type> - System notifications

Security Events

  • security.<action> - Security-related events (e.g., security.login_failed)

Test Events

  • test.ping - Test webhook delivery

Payload Format

All webhook deliveries use this structure:

Headers


Best Practices

  1. Always verify signatures - Prevent spoofed webhooks
  2. Respond quickly - Return 200 OK within 10 seconds (timeout)
  3. Process async - Queue webhooks for background processing
  4. Idempotency - Handle duplicate deliveries gracefully (retries)
  5. Monitor failures - Alert on circuit breaker trips
  6. Rotate secrets - Use regenerate_secret periodically

Rate Limits

  • Creation/updates: 100 requests/minute per API key
  • Delivery timeout: 10 seconds per webhook
  • Max retries: 5 attempts with exponential backoff
  • History retention: Last 200 deliveries per webhook
The automatic retry scheduler runs every 60 seconds and processes up to 50 pending retries per batch.