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.)

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. Classification events carry no metadata — metadata is always null.

Field names changed to snake_case

Until August 2026 these two events shipped their payload keys in camelCase (documentId, supportFileCode, dvsDocumentType, originEventId, chargeCode, agreementCode, invoiceNumber, fileName, classifiedAt, associatedAt) while the envelope was snake_case. They are now snake_case, matching the envelope and the validation events, as documented below.

Timestamps also changed shape: they used to include the zone id (2026-07-31T19:00:39.534247Z[GMT]), which is not valid ISO-8601. They are now emitted as 2026-07-31T19:00:39.534Z.

If your receiver was built against the camelCase names, accept both spellings during the cutover and then drop the camelCase branch.


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": {
"document_id": "9a8b7c6d-5e4f-3210-abcd-ef0987654321",
"support_file_code": "SF-2025-001234",
"dvs_document_type": "INVOICE",
"origin_event_id": "evt-0001-abcd-1234",
"charge_code": "CHG-0001",
"agreement_code": "AGR-0001",
"invoice_number": "F-12345",
"file_name": "factura.pdf",
"classified_at": "2026-06-25T15:33:58.789-06:00",
"associated_at": "2026-06-25T15:34:00.123-06:00"
},
"metadata": null,
"created_at": "2026-06-25T15:34:00.500-06:00"
}

Field reference​

PathTypeOptionalDescription
payload.document_idstring (UUID)NoRCM's internal ID of the document. Same value as entity_id.
payload.support_file_codestringYesCode of the support file.
payload.dvs_document_typestringYesThe document type DVS classified (e.g. INVOICE).
payload.origin_event_idstringYesIdentifier of the inbound event that originated the document, when available.
payload.charge_codestringYesCharge the document is associated to, when applicable.
payload.agreement_codestringYesThe provider-payer agreement code.
payload.invoice_numberstringYesInvoice number the document was associated to, when applicable.
payload.file_namestringYesOriginal filename.
payload.classified_atstring (ISO-8601)NoWhen DVS produced the classification result.
payload.associated_atstring (ISO-8601)NoWhen RCM associated the classified document.

Optional fields are present with a null value, not omitted — this event's payload is serialised from a map, so absent data arrives as an explicit null. Model them as nullable.


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": {
"document_id": "8b7c6d5e-4f3a-2109-bcde-f10987654321",
"origin_event_id": "evt-0002-efgh-5678",
"agreement_code": "AGR-0002",
"file_name": "documento.pdf",
"failed_at": "2026-06-25T15:34:09.123-06:00",
"error_code": "UNKNOWN_DOCUMENT_TYPE",
"error_reason": "The document could not be classified.",
"attempts": 3
},
"metadata": null,
"created_at": "2026-06-25T15:34:12.000-06:00"
}

Field reference​

PathTypeOptionalDescription
payload.document_idstring (UUID)NoRCM's internal ID of the document. Same value as entity_id.
payload.origin_event_idstringYesIdentifier of the inbound event that originated the document, when available.
payload.agreement_codestringYesThe provider-payer agreement code.
payload.file_namestringYesOriginal filename.
payload.failed_atstring (ISO-8601)NoWhen the classification failed.
payload.error_codestringYesMachine-readable failure code from DVS. Match against this, not the message text.
payload.error_reasonstringYesHuman-readable explanation of the failure.
payload.attemptsintegerYesNumber of attempts made, when available.

Optional fields are present with a null value, not omitted — this event's payload is serialised from a map, so absent data arrives as an explicit null. Model them as nullable.


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.