Legal Insights
curl --request POST \
--url https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"matter_id": "<string>",
"deal_id": "<string>",
"focus": [
{}
],
"jurisdiction": "<string>"
}
'import requests
url = "https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights"
payload = {
"matter_id": "<string>",
"deal_id": "<string>",
"focus": [{}],
"jurisdiction": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
matter_id: '<string>',
deal_id: '<string>',
focus: [{}],
jurisdiction: '<string>'
})
};
fetch('https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'matter_id' => '<string>',
'deal_id' => '<string>',
'focus' => [
[
]
],
'jurisdiction' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights"
payload := strings.NewReader("{\n \"matter_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"focus\": [\n {}\n ],\n \"jurisdiction\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"matter_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"focus\": [\n {}\n ],\n \"jurisdiction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"matter_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"focus\": [\n {}\n ],\n \"jurisdiction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"summary": "<string>",
"risks": [
{}
],
"precedents": [
{}
],
"next_steps": [
{}
],
"deadlines": [
{}
],
"counterparty": {},
"regulatory": [
{}
],
"credits_remaining": 123
}
}AI Analysis
Legal Insights
Generate legal-domain insights across a matter or deal - risk analysis, precedent pointers, and workflow recommendations
POST
/
v1
/
ai
/
legal-insights
Legal Insights
curl --request POST \
--url https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"matter_id": "<string>",
"deal_id": "<string>",
"focus": [
{}
],
"jurisdiction": "<string>"
}
'import requests
url = "https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights"
payload = {
"matter_id": "<string>",
"deal_id": "<string>",
"focus": [{}],
"jurisdiction": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
matter_id: '<string>',
deal_id: '<string>',
focus: [{}],
jurisdiction: '<string>'
})
};
fetch('https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'matter_id' => '<string>',
'deal_id' => '<string>',
'focus' => [
[
]
],
'jurisdiction' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights"
payload := strings.NewReader("{\n \"matter_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"focus\": [\n {}\n ],\n \"jurisdiction\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"matter_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"focus\": [\n {}\n ],\n \"jurisdiction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"matter_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"focus\": [\n {}\n ],\n \"jurisdiction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
Body Parameters
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
Show properties
Show properties
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"}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
r = requests.post(
f"{BASE_URL}/v1/ai/legal-insights",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={"matter_id": "matter_01HY1", "jurisdiction": "DE"},
)
print(r.json()["data"]["summary"])
const res = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/ai/legal-insights',
{
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ matter_id: 'matter_01HY1', jurisdiction: 'DE' }),
}
);
const { data } = await res.json();
console.log(data.summary);
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_error | Missing both matter_id and deal_id, or invalid jurisdiction |
| 401 | invalid_key | Invalid or expired API key |
| 402 | insufficient_credits | Workspace credit balance is exhausted |
| 403 | insufficient_permissions | Missing write:ai permission |
| 404 | not_found | Target entity does not exist |
| 429 | rate_limited | Rate limit exceeded |