# Verify document and get report

Verify a previously uploaded document and return a verification report.
The output depends on query parameters:
* `type=json` and `template=report` → JSON report
* `type=rml` and `template=report` → PDF report encoded as **base64**
* `lang` → ISO 3166-1 alpha-2 country codes to choose the language (defaults to system language)

Note: The documentation examples show that if parameters are omitted, the service may return an HTML report;
this spec models the documented JSON/base64 outputs and also allows `text/html` as a fallback.

Endpoint: GET /documents/{document-id}/verify/report
Version: 1.0
Security: AuthToken

## Security:

  - `AuthToken` (unknown)
    apiKey in header Authorization

## Path parameters:

  - `document-id` (string, required)
    Unique document identifier returned by upload (hexadecimal)

## Query parameters:

  - `type` (string)
    Output type (e.g. `json`, `rml`)

  - `template` (string)
    Report template (e.g. `report`)

  - `lang` (string)
    Language code (ISO 3166-1 alpha-2)

## Response 200:

  - `200` (unknown)
    Verification report (JSON) or base64-encoded PDF (or HTML fallback)

## Response 200 fields (application/json):

  - `report` (object)
    High-level report info (e.g. now, type, document_uri, signed_data, ...)

  - `errors` (array)

  - `errors.where` (string)
    JSON path / identifier of where the error occurred

  - `errors.what` (string)
    Error identifier key (can be mapped via `messages` in verification report)

  - `content` (object)
    Present for nested (matrioska) signatures

  - `data` (object)
    Upload/processing metadata (lang, upload_time, documentid, document_hash, ...)

  - `messages` (object)
    Localized message map, keyed by error identifiers

  - `validation` (object)
    Validation details (signatures[], timestamps[], ...)

## Response 400:

  - `400` (unknown)
    Bad Request (e.g. invalid language, unknown report type)

## Response 400 fields (application/json):

  - `title` (string)

  - `description` (string)

  - `code` (string)

  - `message` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized (invalid or missing token)

## Response 401 fields (application/json):

  - `title` (string)

  - `description` (string)

  - `code` (string)

  - `message` (string)

## Response 404:

  - `404` (unknown)
    Resource not found (document expired/missing or wrong id)

## Response 404 fields (application/json):

  - `code` (string, required)
    Example: 404 Not Found

  - `description` (string)

## Response 502:

  - `502` (unknown)
    Upstream/service error (HTML body)

## Response 400 examples:

  - `unknownType` (unknown)

  - `invalidLanguage` (unknown)

## Response 401 examples:

  - `invalidToken` (unknown)

## Response 404 examples:

  - `notFound` (unknown)

