Document Validation
Validates a document against a conformance profile (PDF/A, ISO 19005).#
/lmkit/v1/document-validationEvaluates the candidate document against the selected profile's rule catalog and returns a verdict with one finding per failed rule. The validation re-parses the bytes and judges the document's actual state, independently of whoever produced it; a file that merely declares PDF/A in its metadata is told apart from one that holds up to the rules. The 'pdfa' profile covers the B (basic) conformance of PDF/A-1, PDF/A-2 and PDF/A-3; a document declaring a level outside that coverage yields the 'undetermined' verdict, never a false one. 'flavor' selects the level to validate against, and 'auto' (default) resolves it from the document's own declared identification. The document is not modified and nothing is stored. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
inputrequired | string | The candidate document (base64 or file identifier). |
input_format | How the input is provided. Defaults to 'Base64EncodedFile'. | |
profile | The validation profile to evaluate. Default: 'pdfa'. | |
flavor | The PDF/A flavor to validate against. Default 'auto' resolves it from the document's own declared identification. | |
password | string | Password used to open protected sources. A document that opens but carries encryption still fails the 'encryption.present' rule, as PDF/A prohibits encryption. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 422 | Unprocessable Entity | |
| 400 | Bad Request |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/document-validation" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "",
"input_format": "Base64EncodedFile",
"profile": "pdfa",
"flavor": "auto",
"password": "string"
}'