New legislation and code change triggers

Diurna delivers signed webhook events when the change feed records new statutes, bills, ordinances, regulations, and related updates. Use the same endpoints from Zapier, n8n, or your own worker.

Runnable integration samples are in the Cookbook and in examples/ in the repository.

Requirements

  • Team plan with webhooks enabled.
  • An API key from Settings for POST /api/v1/webhooks.
  • A public HTTPS URL that accepts POST requests with a JSON body.

Create an endpoint

curl -sS -X POST https://trydiurna.com/api/v1/webhooks \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $DIURNA_API_KEY" \
  -d '{"url":"https://hooks.example.com/diurna","description":"Housing changes"}'

The response includes a one-time secret. Store it in your automation vault. Diurna only shows the hint afterward.

Event payload

Each delivery uses type: changes.recorded. The item field matches the change feed entry, including citation and source_url.

{
  "event_id": "chg:12045",
  "type": "changes.recorded",
  "resource_uri": "diurna://changes",
  "changed_at": "2026-10-20T18:00:00.000Z",
  "item": {
    "id": "00000000-0000-4000-8000-000000000050",
    "kind": "statute",
    "title": "Assault in the first degree",
    "citation": "RCW 9A.36.011",
    "source_url": "https://app.leg.wa.gov/RCW/default.aspx?cite=9A.36.011",
    "jurisdiction": "WA",
    "event_type": "content_change"
  }
}

Verify signatures

Requests include x-diurna-timestamp (Unix seconds) and x-diurna-signature (HMAC SHA-256). The signed string is {timestamp}.{raw_body}. Reject timestamps more than five minutes from your clock.

Filter by jurisdiction or citation

Call replay_webhook_changes over MCP or POST /api/webhooks/{id}/replay with optional jurisdiction, citation_prefix, and kind to scope deliveries. Filters persist on the subscription for future events.

Zapier

  1. Create a Zap with trigger Webhooks by Zapier and event Catch Hook.
  2. Copy the Zapier URL into POST /api/v1/webhooks.
  3. In Zapier, add a Code or Filter step that verifies x-diurna-signature using your stored secret.
  4. Map item.citation, item.title, and item.source_url into later actions.

n8n

Import the community template at integrations/n8n/diurna-change-trigger.json in the Diurna source tree (Team clone). It expects a Webhook node URL that you register with Diurna, then verifies the signature before passing the payload downstream.

LangChain

Use Diurna tools from LangChain agents through MCP. Install steps are on Add Diurna to your agent. Reference code lives in integrations/langchain (Team clone).