This endpoint consumes 4 AI credits per call because it uses larger reasoning models tuned for legal text. If the workspace balance is insufficient, the API returns 402 insufficient_credits.
Request
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Optional UUID. Deduplicates retries within 24 hours.
Body Parameters
UUID of a matter to analyze. Provide either matter_id or deal_id.
UUID of a deal to analyze.
Optional subset of insight types: risks, precedents, next_steps, deadlines, counterparty, regulatory. Defaults to all.
Optional ISO 3166-1 alpha-2 country code (or EU subdivision) used to scope precedent suggestions. Defaults to the workspace’s default jurisdiction.
Response
Narrative summary of the matter’s current state
Each item has description, severity, and likelihood
Each item has title, citation, jurisdiction, relevance
Ordered recommended actions
Detected or suggested deadlines with description and due_date
Observations about the counterparty and their legal posture
Applicable regulatory considerations with citations
Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID. Precedent citations are intended as a research starting point and should be independently verified before being relied upon in client work.
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"matter_id": "matter_01HY1", "jurisdiction": "DE"}'
Example Response
{
"data" : {
"summary" : "Cross-border M&A matter involving German and US counterparties; competition review likely triggered." ,
"risks" : [
{ "description" : "Notification threshold under GWB may be met" , "severity" : "high" , "likelihood" : "medium" }
],
"precedents" : [
{ "title" : "Case Hoechst/Rhône-Poulenc" , "citation" : "BKartA B5-213/98" , "jurisdiction" : "DE" , "relevance" : 0.81 }
],
"next_steps" : [
"Confirm worldwide turnover against German merger control thresholds" ,
"Engage competition counsel in Brussels"
],
"deadlines" : [
{ "description" : "Signing target" , "due_date" : "2026-06-30" }
],
"counterparty" : { "observations" : "Represented by a US firm not admitted in Germany; local counsel likely needed." },
"regulatory" : [
{ "regime" : "GWB" , "citation" : "Section 35 GWB" , "notes" : "Merger notification thresholds" }
],
"credits_remaining" : 4854
}
}
Errors
Status Code Description 400 validation_errorMissing both matter_id and deal_id, or invalid jurisdiction 401 invalid_keyInvalid or expired API key 402 insufficient_creditsWorkspace credit balance is exhausted 403 insufficient_permissionsMissing write:ai permission 404 not_foundTarget entity does not exist 429 rate_limitedRate limit exceeded