Skip to main content

Validation events

Validation events fire for every support file that makes it past the classification stage — both v1 uploads (where you sent support_file_code explicitly) and v2 uploads (where DVS classified it first).

There are two terminal outcomes today:

Eventvalidation_statusMeaning
DOCUMENT_VALIDATION_COMPLETEDAPPROVEDContent evaluated as compliant with all applicable rules.
DOCUMENT_VALIDATION_REJECTEDREJECTEDContent evaluated, but one or more rules failed. The errors array carries the detail.

The envelope is the same for all events (see the envelope). For validation events, entity_type is support_file and entity_id is the support file id.

The two events share the same payload shape — they differ in validation_status and whether errors is populated.


DOCUMENT_VALIDATION_COMPLETED​

The support file passed every applicable rule (validation_status: APPROVED). errors is an empty array. field_values lists every field the AI extracted from the document — this is the only place you see the document's content when it approves cleanly.

HeaderValue
X-RCM-Event-TypeDOCUMENT_VALIDATION_COMPLETED

Payload​

{
"event_id": "6f3a1e2c-9b4d-4e21-8a7f-1d9c2b5e3f10",
"event_type": "DOCUMENT_VALIDATION_COMPLETED",
"entity_type": "support_file",
"entity_id": "7e2f9a10-3c4b-4d5e-9f1a-2b3c4d5e6f70",
"payload": {
"document_id": "7e2f9a10-3c4b-4d5e-9f1a-2b3c4d5e6f70",
"support_file_code": "GUIA_TISS",
"document_level": "ACCOUNT",
"account_id": "4a1b2c3d-5e6f-7081-92a3-b4c5d6e7f809",
"provider_slug": "rede-d-or-sao-luiz-central-leste",
"origin_event_id": "9c8b7a6d-5e4f-3021-1a0b-c9d8e7f6a5b4",
"validation_status": "APPROVED",
"precision_percentage": 97.8,
"analysis_type_applied": "AI_DOCUMENT_VALIDATION",
"document_type_code": "TISS_GUIA_SP_SADT",
"errors": [],
"field_values": [
{
"field": "field_01",
"field_label": "1 - Registro ANS",
"value": "005711",
"precision_percentage": null
},
{
"field": "field_02",
"field_label": "2 - Nº Guia no Prestador",
"value": "3398147",
"precision_percentage": 96.4
}
],
"validated_at": "2026-09-18T14:32:07.000-06:00"
},
"metadata": {
"message_id": "e7c1a9b2-3d54-4f68-9a0b-1c2d3e4f5a6b",
"analysis_type_applied": "OCR_FULL"
},
"created_at": "2026-09-18T14:32:08.000-06:00"
}

DOCUMENT_VALIDATION_REJECTED​

The support file was evaluated and one or more rules failed (validation_status: REJECTED). The errors array lists what failed — show these to the end user, they're the actionable feedback.

Header​

HeaderValue
X-RCM-Event-TypeDOCUMENT_VALIDATION_REJECTED

Payload​

{
"event_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"event_type": "DOCUMENT_VALIDATION_REJECTED",
"entity_type": "support_file",
"entity_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"payload": {
"document_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"support_file_code": "SF-2025-005678",
"document_level": "CHARGE",
"account_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"charge_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"provider_slug": "hospital-central",
"origin_event_id": "evt-0002-efgh-5678",
"validation_status": "REJECTED",
"precision_percentage": 42.3,
"analysis_type_applied": "OCR_PARTIAL",
"document_type_code": "CLAIM_FORM",
"errors": [
{
"field": "patientName",
"value": "JHN DOE",
"reason": "NAME_MISMATCH",
"subreason": "POSSIBLE_OCR_ERROR",
"reason_key": "error.document.patient-name-mismatch",
"precision_percentage": 38.5
}
],
"validated_at": "2026-06-25T15:35:14.789-06:00"
},
"metadata": {
"message_id": "f8d2b0c3-4e65-4a79-8b1c-2d3e4f5a6b7c",
"analysis_type_applied": "OCR_PARTIAL"
},
"created_at": "2026-06-25T15:35:18.000-06:00"
}

Field reference​

Both events share this payload:

PathTypeOptionalDescription
payload.document_idstring (UUID)NoID of the analyzed document. Same value as entity_id.
payload.support_file_codestringNoCode of the support file (e.g. SF-2025-001234).
payload.document_levelstringNoScope of the document: ACCOUNT or CHARGE.
payload.account_idstring (UUID)NoAccount associated with the document.
payload.charge_idstring (UUID)YesCharge; omitted for account-level validations.
payload.provider_slugstringNoSlug of the provider.
payload.origin_event_idstringYesIdentifier of the inbound event that originated the validation.
payload.validation_statusstringNoAPPROVED (COMPLETED) or REJECTED (REJECTED).
payload.precision_percentagenumberYesGlobal confidence of the analysis (0–100).
payload.analysis_type_appliedstringNoType of analysis applied (e.g. OCR_FULL, OCR_PARTIAL).
payload.document_type_codestringNoDocument type code (e.g. INVOICE, CLAIM_FORM).
payload.errorsarrayNoList of validation errors; [] when there are none.
payload.field_valuesarrayYesList of every field the AI extracted from the document, whether or not it triggered an error; omitted when DVS did not send it.
payload.validated_atstring (ISO-8601)NoWhen DVS produced the verdict.

And the envelope's metadata for these two events:

PathTypeOptionalDescription
metadata.message_idstring (UUID)YesId of the internal analysis message that produced this verdict. Useful when reporting an issue to support.
metadata.analysis_type_appliedstringYesSame value as payload.analysis_type_applied, repeated at envelope level.

Each element of errors:

PathTypeOptionalDescription
errors[].fieldstringNoField in the document where the error was detected.
errors[].valuestringYesValue read/detected that caused the error.
errors[].reasonstringNoError reason code (e.g. NAME_MISMATCH). Match against this, not the message.
errors[].subreasonstringYesAdditional detail sub-reason (e.g. POSSIBLE_OCR_ERROR).
errors[].reason_keystringYesi18n message key for the error.
errors[].precision_percentagenumberYesConfidence for this specific field (0–100).

Each element of field_values:

PathTypeOptionalDescription
field_values[].fieldstringYesIdentifier of the extracted field (e.g. field_01).
field_values[].field_labelstringYesHuman-readable label for the field (e.g. 1 - Registro ANS).
field_values[].valuestringYesValue extracted for this field.
field_values[].precision_percentagenumberYesConfidence for this specific field (0–100).

None of these four fields is guaranteed non-null.

Fields with a null value are omitted from the JSON.