Handler Firm: Full Integration with Webhooks

Receive case invitations via webhook, respond via API, and sync status updates bidirectionally.


🎯 Overview

📌 TL;DR

You're a firm that receives referrals from other firms. Get notified instantly when invitations arrive, accept or decline via API, and send/receive status updates—all through webhooks for real-time sync.

This guide is for you if:

  • You receive case referrals from other firms via Lexamica

  • You want to accept/decline invitations programmatically

  • You need to send status updates from your system

  • You want real-time webhook notifications

What you'll build:

  • Mappings for invitations and case updates

  • Webhook subscriptions for invitations and incoming updates

  • API calls to respond to invitations

  • API calls to send your status updates

This is the most complex integration pattern because data flows in both directions.


📖 Key Terms

Term
Definition

Handler

Your firm—you receive and handle referred cases

Originator

The firm that sent the case to you

Invitation

A request for you to handle a case

Case Update

A status note posted to a case (you send and receive these)


⚙️ Architecture


📋 Prerequisites

Credentials:

Infrastructure:

Foundational Docs:


💡 Step-by-Step Implementation

Step 1: Create Mappings

CaseInvitation Mapping (for receiving invitations):

Case Mapping (for receiving case details with invitation):

CaseUpdate Mapping (for sending/receiving updates):

Step 2: Create Webhook Subscriptions

Step 3: Handle Incoming Webhooks

Step 4: Respond to Invitations via API

Accept an invitation:

Decline an invitation:

Mark as evaluating:

Step 5: Send Status Updates

Post a status update to a case you're handling:


🔧 Complete Code Example


📋 Invitation Lifecycle

Action
Endpoint
When to Use

Accept

/accept

You want to handle the case

Decline

/decline

You can't take the case (provide reason)

Evaluate

/evaluate

Need more time to decide

Contact Attempted

/contact-attempted

Tried to reach the client

Consult Complete

/consult-complete

Had initial consultation


❓ FAQ

❓ "How do I know when an invitation expires?"

The expires_at field in the invitation payload tells you the deadline. Set up alerts in your system for approaching expirations.


❓ "Can I accept after marking as 'evaluating'?"

Yes. The evaluation state just signals to the originator that you're considering it. You can still accept or decline later.


➡️ Next Steps


Last updated: January 2026

Last updated