# 5. Analyze a Legal Notice & Compute Statutory Deadlines
> Extract quote-grounded facts, statutory limitation clocks, and procedural defects such as NI Act s.138(b) dispatch bars.
Source URL: /docs/recipes/analyze-legal-notice

**Problem:** Legal teams receiving statutory demand notices (for example, under Section 138 of the Negotiable Instruments Act, 1881 or Section 8 of the IBC) need immediate quote-grounded fact extraction, statutory limitation deadlines, and procedural defect checks.

| Step | Endpoint | Scope | Credits |
|---|---|---|---|
| Analyze legal notice (`B5`) | `POST /api/v1/in/notices/analyze` | `ai:run` | 10 |

Go automatically chunks pasted notice text into `<= 11,500`-rune pages (up to 30 pages / 345,000 runes) for the downstream analyzer.

## Implementation [#implementation]

<Tabs items={["cURL","Python (vidhi)","TypeScript (@vidhi/sdk)","Go CLI (vidhi)"]}>
<Tab value="cURL">
```bash
curl -sS -X POST https://api.vidhi.shamik.app/api/v1/in/notices/analyze \
  -H "Authorization: Bearer $VIDHI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "text": "LEGAL NOTICE UNDER SECTION 138 OF THE NEGOTIABLE INSTRUMENTS ACT, 1881. Cheque No. 441209 dated 10.09.2026 for INR 12,50,000 was returned unpaid on 18.09.2026 with memo Funds Insufficient. Demand notice dispatched on 28.10.2026...",
    "receipt_date": "2026-11-20",
    "notice_type": "ni_act_138"
  }'
```
</Tab>

<Tab value="Python (vidhi)">
```python
from vidhi import Vidhi

client = Vidhi()
analysis = client.notices.analyze(
    text=open("notice.txt").read(),
    receipt_date="2026-11-20",
    notice_type="ni_act_138",
)
payload = analysis.model_dump()
print(analysis.category_label, payload.get("clock"))
for defect in payload.get("defects", []):
    print("Defect:", defect)
```
</Tab>

<Tab value="TypeScript (@vidhi/sdk)">
```ts
import { VidhiClient } from "@vidhi/sdk";

const client = new VidhiClient({ apiKey: process.env.VIDHI_API_KEY! });
const analysis = await client.notices.analyze({
  text: noticeText,
  receipt_date: "2026-11-20",
  notice_type: "ni_act_138",
});
console.log(analysis.category_id, analysis.defects, analysis.pathways);
```
</Tab>

<Tab value="Go CLI (vidhi)">
```bash
vidhi notice --file notice.txt --receipt-date 2026-11-20 --notice-type ni_act_138 --json
```
</Tab>
</Tabs>

## Verified Response Excerpt [#verified-response-excerpt]

```json
{
  "category_id": "ni_act_138",
  "category_label": "Cheque Dishonour Notice (NI Act s.138)",
  "tier": 1,
  "primary_statutes": ["Negotiable Instruments Act, 1881 — Section 138(b), Section 138(c)"],
  "facts": {
    "sender_name": "M/s Apex Industrial Suppliers Pvt. Ltd.",
    "recipient_name": "M/s Meridian Infra Projects",
    "claim_amount_inr": 850000,
    "cheque_dishonour_date": "2026-09-18",
    "notice_dispatch_date": "2026-10-28",
    "grounded_quotes": [
      "returned unpaid on 18.09.2026 with memo Funds Insufficient"
    ]
  },
  "clock": {
    "reply_deadline": "2026-12-05",
    "statutory_days": 15,
    "basis": "15 days from receipt_date (2026-11-20) under NI Act s.138(c)"
  },
  "defects": [
    {
      "code": "ni_138b_30_day_bar",
      "summary": "Notice dispatched 40 days after bank return memo (exceeds 30-day statutory bar under s.138(b))."
    }
  ],
  "pathways": [
    {
      "label": "Reply raising s.138(b) limitation defect",
      "rough_cost_inr_range": "15,000 - 35,000",
      "consequence_steps": ["Serve reply via RPAD within 15 days preserving bank memo dates"]
    }
  ],
  "drafting_template_hint": "ni_138_reply_limitation_bar"
}
```