> For the complete documentation index, see [llms.txt](https://integrate.lexamica.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrate.lexamica.com/example-integrations.md).

# Integration Examples

Choose the guide that matches your integration needs.

***

## 🎯 Overview

> **📌 TL;DR**
>
> Find your use case below and follow the corresponding guide. Each guide is self-contained with everything you need to implement that specific integration pattern.

These guides cover the most common integration patterns with the Lexamica API. Each is designed for a specific use case, so you only need to read what's relevant to you.

***

## 📖 Find Your Guide

### What role does your firm play?

```
Are you SENDING cases to other firms?
│
├─► YES: You're an ORIGINATOR
│   │
│   ├─► Just sending leads from a form?
│   │   └─► Lead Form Submission (simplest)
│   │
│   ├─► Sending cases + want updates back?
│   │   ├─► Can receive webhooks? → Originator: Full Integration (Webhooks)
│   │   └─► Need to poll instead? → Originator: Full Integration (Polling)
│   │
│   └─► Importing existing cases with known handlers?
│       ├─► Can receive webhooks? → Import Existing Cases (Webhooks)
│       └─► Need to poll instead? → Import Existing Cases (Polling)
│
└─► NO: You're a HANDLER (receiving cases)
    │
    ├─► Just want to know when cases arrive?
    │   ├─► Can receive webhooks? → Receive Cases (Webhooks)
    │   └─► Need to poll instead? → Receive Cases (Polling)
    │
    └─► Want to respond to invitations + send updates via API?
        ├─► Can receive webhooks? → Handler Firm: Full Integration (Webhooks)
        └─► Need to poll instead? → Handler Firm: Full Integration (Polling)
```

***

## 📋 All Guides at a Glance

### Originator Guides (Sending Cases)

| Guide                                                                               | Use Case                                              | Complexity  | Data Flow          |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------- | ----------- | ------------------ |
| [Lead Form Submission](/example-integrations/1.-lead-form-submission.md)            | Send cases from a web form                            | Minimal     | Outbound only      |
| [Originator: Full (Webhooks)](/example-integrations/3a.-originator-full-webhook.md) | Send cases + receive all updates in real-time         | Medium-High | Bidirectional      |
| [Originator: Full (Polling)](/example-integrations/3b.-originator-full-polling.md)  | Send cases + poll for updates                         | Medium-High | Bidirectional      |
| [Import Existing (Webhooks)](/example-integrations/5a.-import-existing-webhook.md)  | Import cases with known handlers + track via webhooks | Medium      | Outbound + Inbound |
| [Import Existing (Polling)](/example-integrations/5b.-import-existing-polling.md)   | Import cases with known handlers + poll for updates   | Medium      | Outbound + Inbound |

### Handler Guides (Receiving Cases)

| Guide                                                                              | Use Case                                         | Complexity | Data Flow     |
| ---------------------------------------------------------------------------------- | ------------------------------------------------ | ---------- | ------------- |
| [Receive Cases (Webhooks)](/example-integrations/2a.-receive-cases-webhook.md)     | Get notified of new cases via webhook            | Low        | Inbound only  |
| [Receive Cases (Polling)](/example-integrations/2b.-receive-cases-polling.md)      | Poll for new cases (firewall-friendly)           | Low        | Inbound only  |
| [Handler Firm: Full (Webhooks)](/example-integrations/4a.-handler-firm-webhook.md) | Receive invitations + respond via API + webhooks | High       | Bidirectional |
| [Handler Firm: Full (Polling)](/example-integrations/4b.-handler-firm-polling.md)  | Receive invitations + respond via API + polling  | High       | Bidirectional |

### Appendix

| Guide                                                                                           | Use Case                                                                           |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [File Operations](/example-integrations/apx-1.-file-operations.md)                              | Upload, download, and manage case files (works with any integration)               |
| [Dynamic Pickers with Enrichment Endpoints](/example-integrations/apx-2.-enrichment-pickers.md) | Build live, searchable case-type and law-firm pickers (works with any integration) |

***

## ⚙️ Prerequisites (All Guides)

Before starting any integration, ensure you have:

**1. Credentials**

* [ ] Organization ID from Lexamica
* [ ] Public Key (for sending data to Lexamica)
* [ ] Private Key (for configuration and management)

**2. Foundational Docs (read these first)**

| Doc                                                                                                                                                      | Required For                                              |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [Organizations & Authentication](https://github.com/Lexamica/lexamica-docs/tree/main/services/universal-integration/organizations-and-authentication.md) | All integrations                                          |
| [Mapping Engine](https://github.com/Lexamica/lexamica-docs/tree/main/services/universal-integration/mapping-engine.md)                                   | All integrations                                          |
| [Inbound Webhooks](https://github.com/Lexamica/lexamica-docs/tree/main/services/universal-integration/inbound-webhooks.md)                               | Sending cases, responding to invitations, uploading files |
| [Webhook Subscriptions](https://github.com/Lexamica/lexamica-docs/tree/main/services/universal-integration/webhook-subscriptions.md)                     | Receiving events via webhooks                             |
| [Event Storage & Polling](https://github.com/Lexamica/lexamica-docs/tree/main/services/universal-integration/event-storage-polling.md)                   | Receiving events via polling                              |

**3. Infrastructure**

* [ ] Ability to make HTTPS requests to `integration.lexamica.com`
* [ ] For webhooks: publicly accessible HTTPS endpoint
* [ ] For polling: ability to run scheduled jobs

***

## 💡 Choosing Between Webhooks and Polling

| Factor             | Webhooks                       | Polling                               |
| ------------------ | ------------------------------ | ------------------------------------- |
| **Latency**        | Real-time (seconds)            | Depends on poll frequency             |
| **Infrastructure** | Requires public HTTPS endpoint | Outbound requests only                |
| **Firewall**       | Needs inbound access           | Firewall-friendly                     |
| **Complexity**     | Need to handle signatures      | Simpler request/response              |
| **Best for**       | Real-time notifications        | Batch processing, restricted networks |

> **💡 Tip:** If you're unsure, start with webhooks for real-time updates. Switch to polling if your infrastructure doesn't support inbound connections.

***

## 🔧 Quick Reference

### Base URL

```
https://integration.lexamica.com
```

### Common Endpoints

| Purpose                          | Endpoint                                                                     |
| -------------------------------- | ---------------------------------------------------------------------------- |
| Send case to Relay               | `POST /organization/{orgId}/inbound-webhooks/case/{mapId}/send`              |
| Create existing case             | `POST /organization/{orgId}/inbound-webhooks/case/{mapId}/create-existing`   |
| Accept invitation                | `POST /organization/{orgId}/inbound-webhooks/case-invitation/{mapId}/accept` |
| Create mapping                   | `POST /organization/{orgId}/mapping/create`                                  |
| Create webhook subscription      | `POST /organization/{orgId}/webhook-subscriptions/create`                    |
| Create stored event subscription | `POST /organization/{orgId}/stored-event-subscriptions/create`               |
| Query stored events              | `GET /organization/{orgId}/stored-events`                                    |

### Key Events

| Event                      | Triggered When                         |
| -------------------------- | -------------------------------------- |
| `Case Created`             | A new case is created                  |
| `Case Received`            | Your firm receives a case (as handler) |
| `Case Relay Matched`       | Relay Engine finds a partner           |
| `Case Invitation Sent`     | An invitation is sent to a firm        |
| `Case Invitation Accepted` | A firm accepts an invitation           |
| `Case Invitation Declined` | A firm declines an invitation          |
| `Case Update Made`         | A status update is posted              |
| `Case Settlement`          | Settlement process begins              |
| `Case File Uploaded`       | A file is uploaded to a case           |

***

*Last updated: January 2026*
