API reference · schema 1.0

Read Word agreements as structured data.

Agmt Verbatim parses DOCX and DOCM into a legal structure: clause trees, per-view numbering, tracked changes, comment threads, defined terms, cross-references and source ranges.

The parser is deterministic and makes no LLM calls. The same bytes, options and engine version produce byte-identical JSON.

Text, changes and comments are checked against the source on every call. Numbering is reported as not_checked_per_call; its accuracy is measured on the public benchmark. Heuristic results carry confidence and warnings when the source does not establish an answer.

Quickstart

REST with curl

Send DOCX bytes as application/octet-stream. A key is optional; without one, the request uses the keyless tier. Set AGMT_VERBATIM_API_KEY to use a key.

set -eu
VERBATIM_ORIGIN="${VERBATIM_ORIGIN:-https://verbatim.agmt.legal}"
set -- --fail-with-body --silent --show-error \
  --header 'Content-Type: application/octet-stream'
if [ -n "${AGMT_VERBATIM_API_KEY:-}" ]; then
  set -- "$@" --header "Authorization: Bearer $AGMT_VERBATIM_API_KEY"
fi
curl "$@" --data-binary @agreement.docx "$VERBATIM_ORIGIN/v1/parse"

The response has data and meta. Metadata includes the tier, remaining daily quota, included and omitted sections, and a request ID. API errors use application/problem+json and include a code and an agent_instruction.

JavaScript

The ESM package supports Node.js 18+, Workers and browsers.

import { readFile } from 'node:fs/promises';
import { Verbatim } from '@agmt/verbatim';

const verbatim = new Verbatim({
  apiKey: process.env.AGMT_VERBATIM_API_KEY,
  baseUrl: process.env.VERBATIM_API_BASE_URL ?? 'https://verbatim.agmt.legal/v1',
});
const { data, meta } = await verbatim.parse(
  await readFile(process.argv[2]),
  { outputs: ['json', 'markdown_marked'] },
);
console.log({ clauses: data.outline.length, quota: meta.quota });

Run as node parse.mjs agreement.docx. The SDK also provides Unicode code-point offset conversion helpers and a CLI; see agent setup.

Command line

The CLI accepts a local DOCX path and prints the selected view:

npx @agmt/verbatim parse agreement.docx --view marked
npx @agmt/verbatim changes agreement.docx
npx @agmt/verbatim comments agreement.docx

Use npx @agmt/verbatim login to save a key after requesting one. The interactive key prompt is hidden; on POSIX systems, the config file is created with mode 0600.

Python

import os
from agmt_verbatim import Verbatim

verbatim = Verbatim(
    api_key=os.getenv('AGMT_VERBATIM_API_KEY'),
    base_url=os.getenv('VERBATIM_API_BASE_URL', 'https://verbatim.agmt.legal/v1'),
)
result = verbatim.parse('agreement.docx', outputs=['json', 'chunks'])
print({'clauses': len(result.data.outline), 'quota': result.meta['quota']})

After publication, install with python -m pip install agmt-verbatim. The Python SDK also has an asynchronous client and typed selectors for changes, comments, definitions and references.

REST API

Parse endpoint

POST /v1/parse accepts a raw binary body, multipart field file, or a JSON source containing one of file_base64, url or handle. JSON options can be passed in an options object; documented query options are also accepted.

Supported outputs are json, markdown_marked, markdown_accepted, markdown_rejected and chunks. The include option projects report sections from the response. The document is still fully parsed and counted, and meta.included_sections and meta.omitted_sections identify the result.

clause_range filters returned structures; it does not reduce parsing work. The rendered full-document views are omitted for a ranged response because cropping them would invalidate source offsets.

Authentication uses Authorization: Bearer … or X-Verbatim-Key. No key is needed for the keyless tier. See the complete OpenAPI 3.1 document for request schemas and all routes, including quota, key and upload operations.

Canonical output

Schema, views and offsets

Download the JSON Schema 2020-12. The schema is normative; response projections may omit the six report sections listed by the API metadata.

  • accepted contains proposed tracked changes; rejected contains the prior text; marked preserves the source-order union.
  • Offsets are zero-based Unicode code points into a named view, not UTF-16 code units or byte offsets. Ranges are end-exclusive.
  • Comment anchors, revisions and references that can span paragraphs use ranges with start and end positions.
  • markdown_marked uses CriticMarkup: {++inserted++}, {--deleted--}, and {~~old~>new~~} for a same-author substitution. Change IDs and comment anchors follow the documented format.
  • Every preservation field reports its own status. A failed check remains visible with a warning; it does not become a successful result.

Access and limits

Keyless and keyed tiers

  • Keyless: 10 documents per day per IP hash; 5 MiB per file; 100 page-equivalents per document.
  • Free API key: 50 documents per day; 25 MiB per file; 300 page-equivalents per document.
  • A page-equivalent is ceil(words ÷ 500), measured across the document views and supported parts.
  • A repeated parse of the same document with the same key within 24 hours does not count against quota. Burst limiting also applies.

Quota details appear in the response metadata and rate-limit headers. A quota-exhausted response is HTTP 429 with code quota_exceeded; wait and retry only for a rate-limit response. Password-protected documents, legacy .doc, unsupported formats and unsafe archives are rejected.

Get a free API key. Do not place keys in source control or shell history.

Document handling

Processing and uploads

The application is designed to parse document bytes in Worker memory and omit them from application logs and databases. Local CI checks this behavior. Production configuration, log destinations, monitoring and deletion operations have not yet been verified; do not treat this design statement as production verification. Account and quota operations retain service metadata.

Browser uploads are a separate flow: the browser encrypts the document before upload. The encrypted object is accessible for 15 minutes. Physical deletion is asynchronous, and this deployment has no verified physical-deletion deadline; do not infer one from the access expiry.

Set up the remote MCP server, CLI and local stdio MCP →