Skip to main content
POST
/
v1
/
ai
/
legal-insights
Legal Insights
curl --request POST \
  --url https://api.example.com/v1/ai/legal-insights \
  --header 'Content-Type: application/json' \
  --data '
{
  "matter_id": "<string>",
  "deal_id": "<string>",
  "focus": [
    {}
  ],
  "jurisdiction": "<string>"
}
'
{
  "data": {
    "summary": "<string>",
    "risks": [
      {}
    ],
    "precedents": [
      {}
    ],
    "next_steps": [
      {}
    ],
    "deadlines": [
      {}
    ],
    "counterparty": {},
    "regulatory": [
      {}
    ],
    "credits_remaining": 123
  }
}
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

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Idempotency-Key
string
Optional UUID. Deduplicates retries within 24 hours.

Body Parameters

matter_id
string
UUID of a matter to analyze. Provide either matter_id or deal_id.
deal_id
string
UUID of a deal to analyze.
focus
array
Optional subset of insight types: risks, precedents, next_steps, deadlines, counterparty, regulatory. Defaults to all.
jurisdiction
string
Optional ISO 3166-1 alpha-2 country code (or EU subdivision) used to scope precedent suggestions. Defaults to the workspace’s default jurisdiction.

Response

data
object
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

StatusCodeDescription
400validation_errorMissing both matter_id and deal_id, or invalid jurisdiction
401invalid_keyInvalid or expired API key
402insufficient_creditsWorkspace credit balance is exhausted
403insufficient_permissionsMissing write:ai permission
404not_foundTarget entity does not exist
429rate_limitedRate limit exceeded