canonical: https://jentic.com/apis/lexamica.com/lexamica

# Lexamica API

Jentic publishes the only available OpenAPI specification for Lexamica API, keeping it validated and agent-ready. Lexamica provides legal document automation and case management for law firms and legal-ops teams, exposing endpoints for managing cases, attaching and retrieving documents, and routing client referrals through OAuth 2.0 with granular scopes and IP filtering. The 9-endpoint surface focuses on the case lifecycle, document handling, and inbound referral capture so firms can integrate intake and matter management into their broader stack.

## For AI agents

Manage legal cases, attach documents, and route referrals through Lexamica's case management platform with OAuth 2.0 access.

## Scope

Does not handle billing, time tracking, e-signature, or court e-filing - use for case, document, and referral records inside Lexamica only.

## Capabilities

- Open and update legal matters with POST /cases, GET `/cases/{id}`, and PUT `/cases/{id}`
- List the firm's open and closed cases via GET /cases with pagination
- Capture inbound referrals from intake forms or partners through POST /referrals and inspect them with GET /referrals
- Attach and retrieve case-related documents using POST /documents and GET /documents
- Authenticate with OAuth 2.0 authorization code flow including granular read and write scopes
- Verify API connectivity and version with GET /version for health monitoring

## Use cases

### Intake-to-matter automation

A law firm captures website intake submissions and partner referrals as Lexamica referrals via POST /referrals, then converts qualified leads into matters with POST /cases. The integration eliminates manual rekeying between the intake form and the case management system, reducing intake-to-engagement time and ensuring no referral is lost in an inbox.

Example prompt: POST /referrals with the prospect's name, contact, and incident summary, then if qualified, POST /cases with the matter type and reference back to the referral id.

### Document attachment workflow

After a client signs a retainer or uploads supporting evidence, the firm's portal calls POST /documents to attach the file to a Lexamica case and later retrieves the catalogue with GET /documents for matter review. Centralising document references in the case record keeps attorney-client artefacts auditable and avoids local-drive sprawl.

Example prompt: POST /documents with case_id, document type 'retainer', and the storage URL of the signed PDF, then verify GET /documents lists it for that matter.

### Partner referral routing

Co-counsel and referral partners send qualified prospects into the firm's intake. The integration accepts the partner's structured payload and posts it to POST /referrals with the partner identifier attached, then GET /referrals lets the intake team review and triage. This removes email handoff and gives partners a clean API endpoint to integrate against.

Example prompt: POST /referrals with partner_id 'firm_alpha' and the prospect's matter type, then GET /referrals filtered to last 24 hours for the intake team's morning review.

### AI agent matter triage via Jentic

An AI legal-ops agent triages new client emails. When a new matter is identified, the agent searches Jentic for 'create a new legal case' or 'capture a client referral', loads the matching Lexamica operation, and executes with the OAuth tokens held in your Jentic One instance. The agent opens the case, attaches the email as a document, and never sees raw OAuth secrets.

Example prompt: Use Jentic to search 'open a new legal case', load POST /cases, supply matter type 'employment', and attach the originating email via POST /documents.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/cases` | Open a new legal case. |
| GET | `/cases` | List cases. |
| GET | `/cases/{id}` | Get a case by id. |
| PUT | `/cases/{id}` | Update a case. |
| POST | `/referrals` | Capture a new referral. |
| POST | `/documents` | Attach a document. |
| GET | `/documents` | List attached documents. |

## Key resources

- **Cases** — Open, list, retrieve, and update legal matters.
- **Documents** — Attach and list case-related documents.
- **Referrals** — Capture and review inbound client referrals.
- **General** — Read the API version for health checks.

## Why Jentic

- **Setup:** Wiring the Lexamica API by hand means running its OAuth 2.0 authorization-code flow, refreshing access tokens, respecting its IP filtering, and calling api.lexamica.com yourself. Through Jentic you install once, import the Lexamica API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Lexamica puts the case id in the URL path (`/cases/{id}`) and offers read and write scopes, so a rule can pin your agent to reading and updating a case and its documents. You choose the operations it may call, so creating referrals is not included unless you add them.
- **Credential handling:** Your Lexamica OAuth access and refresh tokens are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'open a legal matter' or 'attach a document to a case', and Jentic returns the matching Lexamica operation with its input schema so the agent calls the right endpoint without browsing the Lexamica docs.

## Related APIs

- **PandaDoc API** — Document automation and e-signature platform that pairs with Lexamica for retainer signing.
- **HubSpot API** — CRM that holds firm marketing leads which can be promoted into Lexamica referrals.
- **Salesforce API** — Generic CRM that some firms use as a case management substitute, less specialised than Lexamica.

## FAQ

### Why is there no official OpenAPI spec for Lexamica API?

Lexamica does not publish a maintained OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Lexamica via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Lexamica API use?

Lexamica uses OAuth 2.0 authorization code flow with granular read and write scopes and supports IP filtering on the client. The authorization endpoint is https://api.lexamica.com/oauth/authorize and tokens are issued at https://api.lexamica.com/oauth/token. Through Jentic the OAuth tokens are stored encrypted in your Jentic One instance.

### Can I open and update cases with the Lexamica API?

Yes. POST /cases creates a new matter, GET `/cases/{id}` retrieves it, and PUT `/cases/{id}` updates fields such as status or assigned attorney. GET /cases lists matters for the authenticated firm so an integration can paginate the active book.

### What are the rate limits for the Lexamica API?

Lexamica does not publish exact rate-limit numbers in the public spec. Treat the 9 endpoints as standard OAuth-secured REST: paginate /cases and /documents listings, retry idempotent reads on 429 with backoff, and avoid concurrent writes on the same case_id.

### How do I create a new case through Jentic?

Run 'pip install jentic', search for 'open a new legal case', and Jentic returns POST /cases with its schema. Load the operation, supply the matter type, client, and metadata, and execute. Jentic injects the OAuth bearer token automatically and refreshes it as needed.

### Can I limit what my agent is allowed to do with the Lexamica API?

Yes. Because Jentic One is self-hosted, your own rules decide which Lexamica operations and which OAuth scopes your agent may use. Since Lexamica carries the case id in the URL path (`/cases/{id}`) and offers separate read and write scopes, you can pin an agent to reading and updating a specific case and its documents while leaving out others. If you do not grant the referral operations, POST /referrals stays off limits, so the agent cannot capture new referrals unless you explicitly add that call.
