Decree 30/2020 Document Format Checker API

Check a Vietnamese administrative .docx against Decree 30/2020: A4 paper, margins, Times New Roman, font size and style of each element, page numbers.

POSThttps://apibox.io.vn/v1/vn-nd30-check

Upload a .docx administrative document (quyết định, công văn, thông báo, tờ trình…) and the API checks it against Nghị định 30/2020/NĐ-CP, Phụ lục I: A4 paper in portrait, margins (top and bottom 20–25 mm, left 30–35 mm, right 15–20 mm), Times New Roman everywhere, and the size, bold, italic and capitals of each element: Quốc hiệu (12–13, bold, capitals), Tiêu ngữ (13–14, bold), parent and issuing agency, number and symbol (13), place and date (13–14, italic), document type (13–14, bold, capitals), subject line, "V/v" line, "Kính gửi", body (13–14, justified, line spacing single to 1.5, first-line indent 1–1.27 cm, ≥ 6 pt between paragraphs), signer title and name (13–14, bold), "Nơi nhận" (12, bold italic) and its list (11). It also checks leading zeros in numbers and dates and the page number position.

Fonts and sizes are resolved like Word does: direct formatting, paragraph and character styles, document defaults and theme fonts. Elements are found heuristically from their text (CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM, "Số:", "…, ngày … tháng … năm …", "Nơi nhận:"…), including inside the usual two-column header tables; each element reports its paragraph index, measured values and the rule, and detection_confidence warns when few elements were recognised.

Findings have a severity (error, warning, info) and an English and Vietnamese message. The file is processed in memory and not stored. Old .doc files must be saved as .docx first.

Parameters

NameInTypeRequiredDefault
filebodyfileyesThe .docx document (multipart file, raw body, or file_base64).

Example

curl -X POST "https://apibox.io.vn/v1/vn-nd30-check" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@./my-file"

Response

{
  "page": {
    "width_mm": 215.9,
    "height_mm": 279.4,
    "orientation": "portrait",
    "margins_mm": {
      "top": 25.4,
      "bottom": 25.4,
      "left": 25.4,
      "right": 25.4
    }
  },
  "fonts": {
    "Arial": 574
  },
  "elements": [
    {
      "element": "quoc_hieu",
      "name_vi": "Quốc hiệu",
      "name_en": "National title",
      "found": true,
      "paragraphs": [
        3
      ],
      "text": "CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM",
      "measured": {
        "size_pt": [
          14
        ],
        "bold_share": 1,
        "italic_share": 0,
        "uppercase": true
      },
      "required": {
        "size_pt": [
          12,
          13
        ],
        "bold": true,
        "italic": false,
        "uppercase": true
      },
      "ok": false,
      "issues": [
        "size"
      ]
    },
    {
      "element": "dia_danh_ngay",
      "name_vi": "Địa danh và thời điểm ban hành",
      "name_en": "Place and date",
      "found": true,
      "paragraphs": [
        5
      ],
      "text": "Bắc Ninh, ngày 5 tháng 2 năm 2026",
      "measured": {
        "size_pt": [
          13
        ],
        "bold_share": 0,
        "italic_share": 0,
        "uppercase": false
      },
      "required": {
        "size_pt": [
          13,
          14
        ],
        "italic": true
      },
      "ok": false,
      "issues": [
        "italic"
      ]
    },
    {
      "element": "noi_dung",
      "name_vi": "Nội dung",
      "name_en": "Body text",
      "found": true,
      "paragraphs": [
        8,
        9,
        10
      ],
      "text": "Căn cứ Nghị định số 30/2020/NĐ-CP ngày 05 tháng 3 năm 2020 của Chính phủ về công tác văn thư; | Điều 1. Ban hành kèm theo Quyết định này Quy chế làm việc của Sở Tài chính tỉnh Bắc Ninh, áp dụng cho to",
      "measured": {
        "size_pt": [
          12
        ],
        "bold_share": 0,
        "italic_share": 0,
        "uppercase": false
      },
      "required": {
        "size_pt": [
          13,
          14
        ],
        "italic": false
      },
      "ok": false,
      "issues": [
        "size"
      ]
    }
  ],
  "findings": [
    {
      "element": "page",
      "severity": "error",
      "rule": "paper_a4",
      "en": "Paper is not A4 (210 × 297 mm): 215.9 × 279.4 mm.",
      "vi": "Khổ giấy không phải A4 (210 × 297 mm): 215.9 × 279.4 mm."
    },
    {
      "element": "page",
      "severity": "error",
      "rule": "margin_top",
      "en": "Top margin 25.4 mm; required 20–25 mm.",
      "vi": "Lề trên 25.4 mm; quy định 20–25 mm."
    },
    {
      "element": "page",
      "severity": "error",
      "rule": "margin_bottom",
      "en": "Bottom margin 25.4 mm; required 20–25 mm.",
      "vi": "Lề dưới 25.4 mm; quy định 20–25 mm."
    },
    {
      "element": "page",
      "severity": "error",
      "rule": "margin_left",
      "en": "Left margin 25.4 mm; required 30–35 mm.",
      "vi": "Lề trái 25.4 mm; quy định 30–35 mm."
    },
    {
      "element": "page",
      "severity": "error",
      "rule": "margin_right",
      "en": "Right margin 25.4 mm; required 15–20 mm.",
      "vi": "Lề phải 25.4 mm; quy định 15–20 mm."
    },
    {
      "element": "font",
      "severity": "error",
      "rule": "times_new_roman",
      "en": "Font must be Times New Roman (Unicode TCVN 6909:2001). Other fonts used: Arial (574 chars).",
      "vi": "Phông chữ phải là Times New Roman (bộ mã Unicode TCVN 6909:2001). Đang dùng phông khác: Arial (574 ký tự)."
    },
    {
      "element": "quoc_hieu",
      "severity": "error",
      "rule": "font_size",
      "en": "National title: font size 14 pt; required 12–13 pt.",
      "vi": "Quốc hiệu: cỡ chữ 14; quy định 12–13.",
      "paragraph": 3,
      "text": "CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM"
    }
  ],
  "summary": {
    "errors": 8,
    "warnings": 4,
    "infos": 1,
    "elements_found": 13,
    "compliant": false,
    "detection_confidence": "high"
  },
  "paragraphs": 17,
  "notes": [
    "Elements are detected heuristically from text patterns; documents laid out in unusual tables may be mis-detected (see detection_confidence)."
  ],
  "legal": [
    {
      "ref": "Nghị định 30/2020/NĐ-CP, Phụ lục I và III",
      "effective_from": "2020-03-05",
      "url": "https://vanban.chinhphu.vn/?pageid=27160&docid=199279"
    }
  ],
  "disclaimer": "Reference check, not an official verification; check the official text.",
  "reviewed": "2026-11-11"
}

Use cases

  • Check documents before they are signed and issued
  • Train clerks with an automatic list of format errors
  • Add a format check to a document-management or e-office system
  • Audit templates (mẫu văn bản) of an agency or school

FAQ

Which rules are checked?

Those of NĐ 30/2020/NĐ-CP Phụ lục I that can be read from the file: paper size and orientation, margins, font, size / bold / italic / capitals of each element, body alignment and spacing, leading zeros and page numbers. Wording and the position of the seal are not checked.

How reliable is the element detection?

It is based on text patterns and works on documents built from the official templates. Unusual layouts may be mis-detected; see detection_confidence and the paragraph index of each element.

Is my document stored?

No. The .docx is read in memory for the request and discarded.

Related APIs

Start with 1,000 free requests every month. Get free API key →