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.)
camelCaseUnlike 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:
- Calls DVS asynchronously to classify the document.
- Emits one of
DOCUMENT_CLASSIFICATION_COMPLETEDorDOCUMENT_CLASSIFICATION_FAILED. - 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
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.
Header
| Header | Value |
|---|---|
X-RCM-Event-Type | DOCUMENT_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
| Path | Type | Description |
|---|---|---|
payload.documentId | string (UUID) | RCM's internal ID of the document. Same value as entity_id. |
payload.supportFileCode | string | Code of the support file. |
payload.dvsDocumentType | string | The document type DVS classified (e.g. INVOICE). |
payload.originEventId | string | Identifier of the inbound event that originated the document, when available. |
payload.chargeCode | string | Charge the document is associated to, when applicable. |
payload.agreementCode | string | The provider-payer agreement code. |
payload.invoiceNumber | string | Invoice number the document was associated to, when applicable. |
payload.fileName | string | Original filename. |
payload.classifiedAt | string (ISO-8601) | When DVS produced the classification result. |
payload.associatedAt | string (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
| Header | Value |
|---|---|
X-RCM-Event-Type | DOCUMENT_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
| Path | Type | Description |
|---|---|---|
payload.documentId | string (UUID) | RCM's internal ID of the document. Same value as entity_id. |
payload.originEventId | string | Identifier of the inbound event that originated the document, when available. |
payload.agreementCode | string | The provider-payer agreement code. |
payload.fileName | string | Original filename. |
payload.failedAt | string (ISO-8601) | When the classification failed. |
payload.errorCode | string | Machine-readable failure code from DVS. Match against this, not the message text. |
payload.errorReason | string | Human-readable explanation of the failure. |
payload.attempts | integer | Number 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
| Event | Next step from RCM |
|---|---|
DOCUMENT_CLASSIFICATION_COMPLETED | RCM runs validation next. A DOCUMENT_VALIDATION_* event follows shortly after. |
DOCUMENT_CLASSIFICATION_FAILED | RCM does nothing further for this upload. No validation event will be emitted. |