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

# CosmoLex API

Jentic publishes the only available OpenAPI specification for CosmoLex API, keeping it validated and agent-ready. The CosmoLex API gives law firms programmatic access to their cloud-based practice management workspace, covering contacts, matters, time entries, invoices, trust accounts, calendar events, and tasks across 30 endpoints. Authentication is via a JWT bearer token, and the surface follows a consistent CRUD shape per resource so workflows that touch multiple resources - such as opening a matter, logging time, and invoicing - are straightforward to assemble.

## For AI agents

Manage law-firm contacts, matters, time entries, invoices, trust accounts, calendar events, and tasks in CosmoLex. JWT bearer-token authentication with full CRUD on each resource.

## Scope

Does not handle court e-filing, document automation, or document storage - use for CosmoLex contact, matter, time, invoice, trust, calendar, and task management only.

## Capabilities

- Create, list, update, and delete contacts so the firm's client and counterparty records stay current
- Open, edit, and close matters that anchor every billable engagement and document
- Log, edit, and remove time entries against matters to drive accurate WIP and invoicing
- Generate and retrieve invoices to bill clients for time and disbursements
- Read trust account balances and details to support client-funds reconciliation
- Schedule, update, and cancel calendar events to coordinate hearings, depositions, and meetings
- Create, edit, and complete tasks to track to-dos against a matter or attorney

## Use cases

### Time Capture from Email and Documents

Capture billable time automatically as attorneys send emails or edit documents: an agent or middleware classifies the activity, identifies the matter, and posts a time entry to CosmoLex. This shrinks the time-leak between work performed and time recorded, which is one of the largest profitability drivers for law firms.

Example prompt: On each tracked email, call POST /timeentries with the matter ID, duration, and narrative; then GET /timeentries to confirm it appears in the daily timesheet.

### Matter Intake and Invoice Lifecycle

Onboard a new client, open a matter, log time entries against it, and generate the invoice when the engagement closes. Each step is a single endpoint call, so the intake form and billing process can be wired together without manual portal entry.

Example prompt: Call POST /contacts to create the client, POST /matters to open the matter, POST /timeentries as work is logged, and POST /invoices when the matter is ready to bill.

### Trust Account Reconciliation Reporting

Pull every trust account, fetch the balance for each, and reconcile against the firm's accounting system on a daily cadence. Even though the API is read-only on the trust resource, the listing plus per-account fetch is enough to drive a reconciliation report and flag drift before month-end.

Example prompt: Call GET /trustaccounts to list all trust accounts, then GET `/trustaccounts/{trustAccountId}` for each to capture the balance, and post the totals into the reconciliation worksheet.

### AI Agent Legal Practice Assistant via Jentic

An assistant for a managing partner answers operational questions like 'what are my open tasks today?' or 'what is the WIP on the Smith matter?' by searching Jentic for the right CosmoLex operation. The agent reasons over capabilities rather than memorising CosmoLex's 30-endpoint surface.

Example prompt: Search Jentic for 'list CosmoLex tasks' or 'list time entries by matter', load the matching operation, and execute it with the matter ID or attorney filter the partner asked about.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/matters` | Open a new matter |
| POST | `/contacts` | Create a contact |
| POST | `/timeentries` | Log a time entry |
| POST | `/invoices` | Create an invoice |
| GET | `/trustaccounts/{trustAccountId}` | Read a trust account balance |
| POST | `/events` | Schedule a calendar event |
| POST | `/tasks` | Create a task |

## Key resources

- **Contacts** — Create, read, update, and delete client and counterparty contacts.
- **Matters** — Open, read, update, and close matters that anchor billable work.
- **Time Entries** — Create, read, update, and delete time entries against matters.
- **Invoices** — Create and read invoices for billed work.
- **Trust Accounts** — List trust accounts and read balances.
- **Events** — Schedule, read, update, and cancel calendar events.
- **Tasks** — Create, read, update, and delete tasks.

## Why Jentic

- **Setup:** Wiring CosmoLex by hand means learning its bearer auth, pinning the law.cosmolex.com host, and coding your own requests across matters, contacts, time entries, invoices, and trust accounts. Through Jentic you install once, import CosmoLex from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Most CosmoLex writes post to collection paths like /matters and /invoices with the target in the request body, so scope by operation: limit the agent to the operations it needs, such as creating a time entry or reading a trust account. You choose the operations it may call, so anything outside that set is not reachable unless you add it.
- **Credential handling:** Your CosmoLex token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'log a time entry on a matter' or 'create an invoice', and Jentic returns the matching CosmoLex operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Clio Manage API** — Larger legal practice management platform with deeper third-party app marketplace than CosmoLex.
- **Xero Accounting API** — General-ledger accounting platform that can ingest CosmoLex invoices and trust transactions.
- **Stripe API** — Payment processor that can collect on CosmoLex invoices via card or ACH.

## FAQ

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

CosmoLex publishes API documentation but not a single OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call CosmoLex API 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 CosmoLex API use?

The API uses HTTP bearer-token authentication with JWTs: every request must carry an Authorization: Bearer <jwt> header. Through Jentic the JWT is held in the encrypted vault and injected per call so the agent never sees the raw token.

### Can I log a time entry against a matter with this API?

Yes. POST /timeentries creates a time entry tied to a matter ID, duration, and narrative, which is the canonical primitive for any time-capture automation built on top of CosmoLex.

### Can I read trust account balances?

Yes. GET /trustaccounts lists every trust account on the firm and GET `/trustaccounts/{trustAccountId}` returns the detail for one account, which is enough to drive a daily reconciliation report. The current spec does not expose write operations on trust accounts.

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

The OpenAPI spec does not declare numeric rate limits. Treat HTTP 429 responses as authoritative, back off using the Retry-After header where present, and consult the CosmoLex support team for plan-specific limits before high-volume sync jobs.

### How do I create a matter through Jentic?

Search Jentic for 'create CosmoLex matter', load POST /matters, and execute it with the contact ID, matter type, and description. Jentic returns the operation schema so the agent does not need to read CosmoLex docs to know which fields are required.

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

Yes. Because you run Jentic One yourself, your own rules decide which CosmoLex operations and credentials the agent can use, and anything outside that set is not reachable. Most CosmoLex writes post to collection paths such as POST /matters, POST /timeentries, and POST /invoices with the target in the request body, so you scope by operation: grant only what the agent needs, for example creating a time entry, while withholding matter or invoice creation. You can keep the agent read-only on sensitive resources by allowing GET /trustaccounts and GET `/trustaccounts/{trustAccountId}` without granting any write operation.
