Receive Cases via Webhook

Get notified instantly when cases are assigned to your firm.


🎯 Overview

📌 TL;DR

Set up a webhook to receive automatic notifications when cases are sent to your firm. Handle everything else (accepting, declining, updates) in the Lexamica platform.

This guide is for you if:

  • You receive referrals from other firms via Lexamica

  • You want to be notified immediately when new cases arrive

  • You'll handle invitations and updates through the Lexamica UI

What you'll build:

  • A Case mapping to receive data in your format

  • A webhook subscription for the Case Received event

  • A webhook handler that stores incoming cases

What this does NOT cover:

  • Accepting/declining invitations via API

  • Sending status updates via API

  • Sending cases to other firms

For full API-based handling, see Handler Firm: Full Integration with Webhooks


📖 Key Terms

Term
Definition

Webhook Subscription

Configuration that tells Lexamica to POST events to your URL

Case Received

Event triggered when your firm receives a case from another firm

Signature

HMAC-SHA256 hash to verify webhooks are from Lexamica


⚙️ Architecture

🎯 Key Takeaway

Lexamica pushes case data to you the moment it arrives. You don't need to poll or check manually.


📋 Prerequisites

Credentials:

Infrastructure:

Foundational Docs:


💡 Step-by-Step Implementation

Step 1: Create Your Case Mapping

Create a mapping that transforms Lexamica's Case fields to your format.

Request:

Response:

Step 2: Create a Webhook Subscription

Subscribe to the Case Received event.

Request:

⚠️ Warning: Keep your secret secure. You'll use it to verify that webhooks are actually from Lexamica.

Step 3: Build Your Webhook Handler

Create an endpoint that receives and processes the webhook.

What your endpoint receives:

Headers:

Body (in your field format):


🔧 Complete Code Example

Node.js/Express Webhook Handler

Python/Flask Webhook Handler


❓ FAQ

❓ "How do I test my webhook endpoint?"

📝 Full Answer: Use the test endpoint to send a sample webhook:


❓ "Why is signature verification failing?"

🔍 Quick Check:


❓ "What if my server is down?"

📝 Full Answer: Lexamica retries failed webhooks with exponential backoff:

  • Immediate, +30s, +2min, +5min, +15min

If all retries fail, the event is logged. For guaranteed delivery, consider using polling as a backup.


🔧 Troubleshooting

"Webhooks not arriving"

"401 responses in Lexamica logs"

  • Your endpoint is returning 401—check signature verification logic

"Processing takes too long"

  • Return 200 immediately, then process asynchronously

  • Use a job queue (Bull, Celery, etc.) for heavy processing


➡️ Next Steps


Last updated: January 2026

Last updated