Skip to main content

Classification events

Classification events fire only for support files uploaded via the v2 endpoint with support_file_code omitted. (For v1 uploads, your system already knew the document type — there's nothing for DVS to classify.)

Payload keys are camelCase

Unlike the envelope and the other stable events, the payload object of DOCUMENT_CLASSIFICATION_* uses camelCase keys (documentId, supportFileCode, errorCode…). Optional fields that RCM has no value for are present with null; they are not omitted.

After upload, RCM:

  1. Calls DVS asynchronously to classify the document.
  2. Emits one of DOCUMENT_CLASSIFICATION_COMPLETED or DOCUMENT_CLASSIFICATION_FAILED.
  3. If classification completed, RCM then runs validation and emits a DOCUMENT_VALIDATION_* event afterwards.

So the typical happy-path sequence is:

POST /rcm/v2/support-files/upload → 202 Accepted
▼ (async, ~5-15s later)
webhook: DOCUMENT_CLASSIFICATION_COMPLETED → document type detected + associated
▼ (async, ~10-30s later)
webhook: DOCUMENT_VALIDATION_COMPLETED → rules evaluated, content approved
Best-effort delivery

Classification events are emitted best-effort: a failure to publish the webhook never rolls back the classification/association of the document in RCM.

The envelope is the same for all events (see the envelope). For classification events, entity_type is support_document and entity_id is the document id.


DOCUMENT_CLASSIFICATION_COMPLETED

Fired when DVS successfully classified and associated the support file.

HeaderValue
X-RCM-Event-TypeDOCUMENT_CLASSIFICATION_COMPLETED

Payload

{
"event_id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"event_type": "DOCUMENT_CLASSIFICATION_COMPLETED",
"entity_type": "support_document",
"entity_id": "9a8b7c6d-5e4f-3210-abcd-ef0987654321",
"payload": {
"documentId": "9a8b7c6d-5e4f-3210-abcd-ef0987654321",
"supportFileCode": "SF-2025-001234",
"dvsDocumentType": "INVOICE",
"originEventId": "evt-0001-abcd-1234",
"chargeCode": "CHG-0001",
"agreementCode": "AGR-0001",
"invoiceNumber": "F-12345",
"fileName": "factura.pdf",
"classifiedAt": "2026-06-25T15:33:58.789-06:00",
"associatedAt": "2026-06-25T15:34:00.123-06:00"
},
"metadata": {},
"created_at": "2026-06-25T15:34:00.500-06:00"
}

Field reference

PathTypeDescription
payload.documentIdstring (UUID)RCM's internal ID of the document. Same value as entity_id.
payload.supportFileCodestringCode of the support file.
payload.dvsDocumentTypestringThe document type DVS classified (e.g. INVOICE).
payload.originEventIdstringIdentifier of the inbound event that originated the document, when available.
payload.chargeCodestringCharge the document is associated to, when applicable.
payload.agreementCodestringThe provider-payer agreement code.
payload.invoiceNumberstringInvoice number the document was associated to, when applicable.
payload.fileNamestringOriginal filename.
payload.classifiedAtstring (ISO-8601)When DVS produced the classification result.
payload.associatedAtstring (ISO-8601)When RCM associated the classified document.

Optional fields are present with a null value when RCM has no data for them; they are not omitted.


DOCUMENT_CLASSIFICATION_FAILED

Fired when DVS could not classify/associate the support file (unrecognised document type, association error, or an unexpected error).

Header

HeaderValue
X-RCM-Event-TypeDOCUMENT_CLASSIFICATION_FAILED

Payload

{
"event_id": "d2e3f4a5-b6c7-8901-bcde-f10987654321",
"event_type": "DOCUMENT_CLASSIFICATION_FAILED",
"entity_type": "support_document",
"entity_id": "8b7c6d5e-4f3a-2109-bcde-f10987654321",
"payload": {
"documentId": "8b7c6d5e-4f3a-2109-bcde-f10987654321",
"originEventId": "evt-0002-efgh-5678",
"agreementCode": "AGR-0002",
"fileName": "documento.pdf",
"failedAt": "2026-06-25T15:34:09.123-06:00",
"errorCode": "UNKNOWN_DOCUMENT_TYPE",
"errorReason": "The document could not be classified.",
"attempts": 3
},
"metadata": {},
"created_at": "2026-06-25T15:34:12.000-06:00"
}

Field reference

PathTypeDescription
payload.documentIdstring (UUID)RCM's internal ID of the document. Same value as entity_id.
payload.originEventIdstringIdentifier of the inbound event that originated the document, when available.
payload.agreementCodestringThe provider-payer agreement code.
payload.fileNamestringOriginal filename.
payload.failedAtstring (ISO-8601)When the classification failed.
payload.errorCodestringMachine-readable failure code from DVS. Match against this, not the message text.
payload.errorReasonstringHuman-readable explanation of the failure.
payload.attemptsintegerNumber of attempts made, when available.

Optional fields are present with a null value when RCM has no data for them; they are not omitted.


What happens after each event

EventNext step from RCM
DOCUMENT_CLASSIFICATION_COMPLETEDRCM runs validation next. A DOCUMENT_VALIDATION_* event follows shortly after.
DOCUMENT_CLASSIFICATION_FAILEDRCM does nothing further for this upload. No validation event will be emitted.