173 API endpoints. Built like an OS.
LexPrime OS exposes a comprehensive REST API across AI tools, case management, trust accounting, payments, communications, the client portal, and 12 SA practice-area modules. All AI runs on local Ollama — no client data leaves SA jurisdiction.
173
Total endpoints
27
AI endpoints
11
Categories
12
Practice modules
LexPrime OS is a Next.js application — the API lives under /api/ (or /demo/api/ on the demo). All endpoints accept and return JSON.
Base URL (self-hosted):
https://yourfirm.lexprime.co.za/demo/apiAuthentication (firm-side):
POST /auth/login
Content-Type: application/json
{
"email": "attorney@yourfirm.co.za",
"password": "your-password"
}
# Response: { "success": true, "user": { "id": "...", "role": "attorney" } }
# The user ID is then passed as ?userId=xxx on subsequent callsExample — draft a document with AI:
POST /ai/draft
Content-Type: application/json
{
"caseId": "cmqgdtdr...",
"docType": "summons",
"instructions": "RAF claim, rear-end collision, moderate whiplash"
}
# Response: { "document": "IN THE HIGH COURT OF SOUTH AFRICA...", "docType": "summons" }
# Runs on local Ollama — no data sent to external APIsAuth model
Email + password (bcrypt 12 rounds). 2FA via TOTP/SMS/email optional. Role-based access control enforced per-endpoint. Client portal uses separate portal auth.
AI runs locally
All 27 AI endpoints call Ollama at 127.0.0.1:11434. No external API calls. Client data never leaves your server. POPIA Section 72 compliant by design.
Self-hosted
Deployed on your SA VPS. SQLite for demo; PostgreSQL recommended for production. PM2 process manager. Apache or Nginx reverse proxy. Full data sovereignty.
All 173 endpoints by category
Click a category to expand. Each endpoint shows HTTP method, path, description, and auth requirement.
Login, registration, password reset, user management, 2FA, sessions.
/auth/loginAuthenticate user with email + password/auth/registerRegister a new user (admin only)/auth/meGet current user profile/auth/forgot-passwordTrigger password reset email/auth/reset-passwordReset password with token/auth/usersList or create users (admin only)/auth/users/[id]Get, update, or delete a user/auth/users/[id]/deleteSoft-delete a user (preserve audit trail)/2faGet 2FA status or enable 2FA (TOTP/SMS/email)/2fa/verifyVerify 2FA code and complete loginAll 21 AI features. Each runs on local Ollama — no client data leaves SA. AI must be enabled in settings.
/aiGeneral AI chat endpoint (system prompt + user message)/ai/draftDraft a legal document (summons, pleading, affidavit, etc.)/ai/searchNatural-language legal search across knowledge base/ai/summarizeGenerate AI case summary/ai/timelineBuild chronological timeline of case events/ai/deadlinesExtract prescription and filing deadlines from documents/ai/riskAssess factual, legal, and procedural risks in a case/ai/next-stepsGenerate recommended action items for a case/ai/client-commDraft client communications (updates, demands, reminders)/ai/document-compareCompare two documents with risk-aware diff/ai/medical-summarySummarise medical records for RAF / personal injury/ai/judgmentAnalyse court judgment — extract holdings and principles/ai/judge-analyticsAnalyse judge tendencies and historical success rates/ai/precedentFind similar cases in firm database/ai/contract-reviewAI contract analysis — risks, obligations, key dates/ai/predictivePredict case outcome based on historical data/ai/settlementEstimate settlement value based on case parameters/ai/compliancePOPIA / FICA / trust accounting compliance audit on text/ai/conflict-checkConflict-of-interest check against firm client database/ai/memoGenerate structured legal memo (issues, analysis, recommendations)/ai/intakeAI-assisted matter intake — extract parties, facts, claims/ai/estimateEstimate matter complexity and billable hours/ai/time-trackingAI-categorised time tracking for billable activities/ai/bulk-importAI-categorise bulk document uploads/ai/bulk-import/confirmConfirm and persist bulk-import categorisation/ai/modelsList available Ollama models/ai/testTest Ollama connection and model responseCase management — create, update, list, search. Includes court dates, notes, tasks, experts, documents, settlements, trust transactions.
/casesList cases (with filters) or create a new case/cases/[id]Get, update, or archive a case/cases/[id]/notesCase notes (chronological)/cases/[id]/tasksTasks linked to a case/cases/[id]/court-datesCourt dates and hearing schedule/cases/[id]/documentsDocuments linked to a case/cases/[id]/expertsExpert witnesses linked to a case/cases/[id]/settlementsSettlement offers and negotiations/cases/[id]/trustTrust transactions for a caseSpecialised endpoints for each of the 12 SA practice-area modules.
/conveyancingConveyancing matters — list or create/conveyancing/[id]Get or update a conveyancing matter/conveyancing/[id]/milestonesTransfer milestones (deeds office workflow)/litigationLitigation matters — list or create/litigation/[id]Get or update a litigation matter/family-lawFamily law matters (divorce, custody, maintenance)/family-law/[id]Get or update a family law matter/labourLabour / CCMA matters/labour/[id]Get or update a labour matter/criminalCriminal law matters (dockets, bail, appearances)/criminal/[id]Get or update a criminal matter/corporateCorporate / commercial matters/corporate/[id]Get or update a corporate matter/estatesWills & estates matters/estates/[id]Get or update an estates matter/immigrationImmigration matters (visas, DHA)/immigration/[id]Get or update an immigration matter/ipIntellectual property matters (CIPC / WIPO)/ip/[id]Get or update an IP matter/maritimeMaritime / admiralty matters/maritime/[id]Get or update a maritime matter/collectionsCollections matters (s129, EAO)/collections/[id]Get or update a collections matterDocument management, versioning, OCR, AI template generation.
/documentsList or upload documents/documents/[id]Get, update, or delete a document/documents/[id]/versionsDocument version history/documents/versionsList all versions across documents/documents/generateGenerate a document from a template/document-templatesList or create document templates/document-templates/[id]Get, update, or delete a template/document-templates/[id]/generateGenerate a document from a specific templateTrust transactions, bank accounts, reconciliation, accounting exports (Pastel / Sage compatible).
/bank-accountsList or add bank accounts/bank-accounts/[id]Get, update, or delete a bank account/bank-accounts/[id]/transactionsBank transactions for an account/reconciliationReconciliation batches/accounting-exportsList or create accounting exports/accounting-exports/[id]/generateGenerate CSV export (Sage / Xero / Pastel format)/billingBilling records/invoicesInvoices — list or create/invoices/[id]Get or update an invoice/expensesExpenses — list or create/expenses/[id]Get, update, or delete an expenseSA payment gateway integration — PayFast, Ozow, Yoco. AI allocation of payments to matters.
/paymentsList payments or record a manual payment/payments/initiateInitiate a gateway payment (PayFast/Ozow/Yoco)/payments/gatewaysList or configure payment gateways/payments/webhook/payfastPayFast webhook handler (signature verified)/payments/webhook/ozowOzow webhook handler (signature verified)/payments/proofPayment proof uploads/payments/proof/[id]Get or delete a payment proof/payments/proof/listList payment proofs (with filters)/payments/ai-allocateAI-allocate a payment to matter(s)/payments/portal-invoicesPortal-side invoice list (for clients)WhatsApp, email, internal notes. Centralised inbox with case auto-linking.
/communicationsList or log a communication/whatsappWhatsApp integration status and outbound messages/whatsapp/webhookInbound WhatsApp webhook (from gateway)/emailEmail integration — list or send/email/messagesEmail messages with filters/email/fetchFetch new emails from IMAP/matter-chat/[caseId]/messagesTeam chat messages for a matter/matter-chat/[caseId]/pinPin a chat message/matter-chat/[caseId]/reactionsAdd a reaction to a chat message/chatInternal chat — list or send/chat/[id]/messagesMessages in a chat threadClient-facing portal — cases, documents, invoices, payments, communications.
/portal/authClient portal login/portal/casesCases visible to the logged-in client/portal/documentsDocuments shared with the client/portal/communicationsCommunications with the client/portal/messagesClient-firm secure messaging/portal/paymentsClient's invoices and payment history/portal/forgot-passwordClient portal password reset/portal-uploadsDocuments uploaded by client via portal/portal-uploads/[id]/reviewFirm reviews a client-uploaded document/portal-activityAudit log of client portal activityFICA verification, e-signatures, prescription alerts, conflict checks.
/ficaFICA records — list or create/fica/[id]Get or update a FICA record/fica/[id]/verifyMark FICA record as verified/signing-requestsE-signature requests — list or create/signing-requests/[id]Get or update a signing request/prescription-alertsPrescription deadline alerts/prescription-alerts/[id]Get or update a prescription alert/prescription-alerts/checkRun prescription check across all mattersWorkflow automation, notifications, leads, reports, search, system settings.
/workflowsWorkflow rules — list or create/workflows/[id]Get, update, or delete a workflow/tasksTasks — list or create/tasks/[id]Get, update, or delete a task/leadsLeads (CRM pipeline) — list or create/leads/[id]Get or update a lead/leads/[id]/convertConvert a lead to a client + matter/expertsExpert witnesses — list or create/experts/[id]Get, update, or delete an expert/notificationsUser notifications/notifications/[id]/readMark a notification as read/notifications/read-allMark all notifications as read/alertsSystem alerts (prescription, deadlines, etc.)/reportsStandard reports/reports/advancedAdvanced analytics and custom reports/searchGlobal search across cases, clients, documents/search/advancedAdvanced search with multiple filters/settingsSystem settings (firm name, branding, etc.)/settings/themeUpdate theme (light/dark, colors)/settings/logoUpload firm logo/modulesGet or toggle module activation/client-updatesClient status updates/client-updates/broadcastBroadcast update to multiple clients/receptionistAI receptionist settings/superadminSuper admin panel data (superadmin only)/gatewayPayment gateway status/sseServer-sent events stream (real-time updates)/sse/eventsSSE event stream (alternative endpoint)Multi-tenant API (roadmap)
The current API is self-hosted per firm — each customer runs their own instance. A hosted multi-tenant API at api.lexprime.co.za/v1with OAuth2, per-firm rate limiting, and webhook subscriptions is on the 2027 roadmap. If you're an IT consultant or systems integrator evaluating LexPrime for multiple firms,email us— we want to talk.