NeuralRevNeuralRevDocs
API Reference

Encounters

Create or update encounter records and manage documents via the Integration API.

Create or update encounter (patient visit) records and manage associated documents.

Upsert Encounter

POST /integration/encounters

Creates or updates an encounter by id. Referenced entities (patient_id, provider_id, rendering_provider_id, facility_id) must use the same id values you provided when creating those records via their respective endpoints.

Request Body

FieldTypeRequiredDescription
idstringYesYour unique identifier for this encounter
patient_idstringYesPatient ID (must exist)
provider_idstringNoBilling/attending provider ID
rendering_provider_idstringNoRendering provider ID (if different)
facility_idstringNoFacility ID where service was rendered
date_of_servicestring (ISO 8601)NoDate and time of service
visit_typestringNoType of visit (see values below)
statusstringNoEncounter status
is_completedbooleanNoWhether the encounter is complete

Visit Types

ValueDescription
office_visitStandard office visit
telehealthVirtual/telehealth visit
inpatientInpatient admission
outpatientOutpatient procedure
emergencyEmergency department visit
observationObservation stay
surgicalSurgical procedure

Example Request

curl -X POST https://api.neuralrev.ai/integration/encounters \
  -H "x-api-key: nrev_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "ENC-001",
    "patient_id": "PAT-001",
    "provider_id": "PROV-001",
    "rendering_provider_id": "PROV-002",
    "facility_id": "FAC-001",
    "date_of_service": "2026-01-15T09:00:00Z",
    "visit_type": "office_visit",
    "status": "completed",
    "is_completed": true
  }'

Response

200 OK — Encounter upserted successfully:

{
  "success": true,
  "message": "Encounter upserted successfully"
}

400 Bad Request — Referenced entity not found:

{
  "error": "Patient not found for id: PAT-999"
}

Notes

  • Create patients, providers, and facilities before creating encounters that reference them.
  • If rendering_provider_id is not provided, the provider_id is assumed to be the rendering provider.
  • Setting is_completed: true marks the encounter as ready for billing workflow.

Upload Document

POST /integration/encounters/{id}/documents

Uploads a document to an encounter. If a document with the same document_id already exists, it is replaced.

Path Parameters

ParameterTypeDescription
idstringEncounter ID

Request Body (multipart/form-data)

FieldTypeRequiredDescription
filebinaryYesThe document file (PDF or DOCX)
document_idstringYesYour unique identifier for this document
categorystringYesDocument category (see values below)

Document Categories

ValueDescription
radiology_reportRadiology/imaging reports
lab_resultsLaboratory test results
diagnostic_reportOther diagnostic reports
progress_reportClinical progress notes
discharge_summaryHospital discharge summary
doctor_notesPhysician notes
medical_recordGeneral medical records
patient_historyPatient history documents
immunization_reportImmunization records
referralReferral letters
consent_formPatient consent forms

Example Request

curl -X POST https://api.neuralrev.ai/integration/encounters/ENC-001/documents \
  -H "x-api-key: nrev_YOUR_API_KEY" \
  -F "file=@/path/to/clinical-notes.pdf" \
  -F "document_id=DOC-001" \
  -F "category=doctor_notes"

Response

200 OK — Document uploaded successfully:

{
  "success": true,
  "document_id": "DOC-001"
}

404 Not Found — Encounter not found:

{
  "error": "Encounter not found"
}

Constraints

  • Maximum file size: 250 MB
  • Supported formats: PDF (.pdf) and DOCX (.docx)
  • If you upload with an existing document_id, the previous file is replaced

Delete Document

DELETE /integration/encounters/{id}/documents/{documentId}

Deletes a document from an encounter.

Path Parameters

ParameterTypeDescription
idstringEncounter ID
documentIdstringDocument ID (the document_id used during upload)

Example Request

curl -X DELETE https://api.neuralrev.ai/integration/encounters/ENC-001/documents/DOC-001 \
  -H "x-api-key: nrev_YOUR_API_KEY"

Response

200 OK — Document deleted successfully:

{
  "success": true,
  "message": "Document deleted successfully"
}

404 Not Found — Document or encounter not found:

{
  "error": "Document not found"
}

On this page