# Vietnamese Legal Document (full text) API

> Get a Vietnamese legal document by id: all attributes, validity and effective dates, related documents (amends, replaces, guides) and the text or HTML.

- Endpoint: `GET | POST https://apibox.io.vn/v1/vn-law-document/{id}`
- Category: Data & JSON
- HTML docs: https://apibox.io.vn/docs/vn-law-document/ (Vietnamese: https://apibox.io.vn/vi/docs/vn-law-document/)
- Online tool: https://apibox.io.vn/tools/vn-law-document/
- Authentication: `Authorization: Bearer <API key>` or `X-API-Key: <API key>` (free key: https://apibox.io.vn/dashboard/#signup)

Pass the id from `/v1/vn-law-search` or `/v1/vn-law-lookup` to get the full record: number, title, type, status, `inForce`, agency, signer, issue / effective / expiry / gazette dates, scope, sector and field, plus `relations` — the documents it is based on, amends, replaces or guides, and those that amend, replace or guide it, in both directions, each with its own status.

`content=text` adds the text as plain text with line breaks kept and table cells separated by tabs, ideal for LLM / RAG pipelines; `content=html` returns clean HTML with absolute links; `relations=0` skips the relation tree. `hasContent: false` means only a PDF exists on vbpl.vn and `content` is null. For a list of up to 20 documents without text, pass `ids=1,2,3`.

Data: national legal database vbpl.vn (Ministry of Justice), refreshed nightly; part of the metadata CC BY 4.0 (attribution in every answer). Reference only: the Official Gazette text prevails.

## Parameters

| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| `id` | path | string | yes |  | Numeric document id from vn-law-search / vn-law-lookup (path or `?id=`). |
| `content` | query | string | no | `none` | `none`, `text` (plain text) or `html`. |
| `relations` | query | boolean | no | `true` | `0` to skip related documents. |
| `ids` | query | string | no |  | Up to 20 ids (comma-separated) for a list of attributes without text. |

## Example request

```bash
curl "https://apibox.io.vn/v1/vn-law-document/179252?relations=0" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Example response

```json
{
  "id": "179252",
  "title": "Luật Bảo vệ dữ liệu cá nhân số 91/2025/QH15",
  "number": "91/2025/QH15",
  "type": "Luật",
  "status": "Còn hiệu lực",
  "agency": "Quốc hội",
  "issuedDate": "26/06/2025",
  "effectiveDate": "01/01/2026",
  "expiryDate": null,
  "gazetteDate": null,
  "scope": "Trung ương",
  "sector": null,
  "field": "Chưa phân loại",
  "signerTitle": "Chủ tịch Quốc hội",
  "signer": "Trần Thanh Mẫn",
  "collectedFrom": null,
  "applicability": null,
  "inForce": true,
  "url": "https://thuvienphapluat.io.vn/van-ban/179252/luat-bao-ve-du-lieu-ca-nhan-so-91-2025-qh15",
  "hasContent": true,
  "source": {
    "name": "Thư viện Pháp luật Mở (thuvienphapluat.io.vn)",
    "texts": "National legal database vbpl.vn (Ministry of Justice); legal normative documents are not protected by copyright (IP Law art. 15)",
    "metadata_licence": "Part of the metadata: \"Vietnamese Legal Documents\" dataset by Thịnh Ngô, CC BY 4.0",
    "disclaimer": "Reference only; the text published in the Official Gazette (Công báo) prevails."
  }
}
```

## Use cases

- Show the full text of a regulation inside your app
- Chunk legal texts for an LLM / RAG knowledge base
- Follow the amendment chain to the current version of a rule
- Alert users when a document they rely on is replaced

## FAQ

### Which content format should I use for AI?

content=text: plain text with line breaks and tab-separated table cells, without HTML noise.

### What are relations?

The links between documents (based on, amends, replaces, guides, and the reverse), each with number, title, status and whether the library has it.

### Why is content null?

Some documents exist only as scanned PDFs on vbpl.vn (hasContent: false). The attributes and relations are still returned.
