RFC-0009: Subscriptions

Webhook notifications for intent and portfolio events.

Abstract

This RFC defines the subscription mechanism for receiving webhook notifications about intent and portfolio events.

Subscription Structure

{
  "id": "uuid",
  "intent_id": "uuid",
  "subscriber_id": "monitoring-service",
  "event_types": ["state_changed", "status_changed"],
  "webhook_url": "https://example.com/webhooks/openintent",
  "expires_at": "2024-02-15T00:00:00Z"
}

Event Delivery

When matching events occur, webhooks are delivered with:

POST https://example.com/webhooks/openintent
Content-Type: application/json
X-OpenIntent-Event: state_changed
X-OpenIntent-Signature: sha256=...

{
  "event": { ... },
  "intent": { ... },
  "subscription_id": "uuid"
}

Retry Policy

Failed deliveries are retried with exponential backoff.