Skip to main content
Operation events fire when Cobalt performs an RPA action inside your EHR system. They confirm the success or failure of operations Cobalt initiated on your behalf — creating appointments, adding patient insurance, uploading notes, creating tasks, and so on.
Some events listed here (appointment.created, appointment.updated, patient.updated) also fire from EHR sync when staff make changes directly in the EHR. See Sync Events for those.

Payload Envelope

Every operation event uses this envelope:

Structured Error Codes

Operation failure events (appointment.failed, patient.failed, etc.) include structured error codes so you can handle different failure scenarios programmatically:
  • Machine-readable error codes — parse errors programmatically instead of string matching
  • Context-aware descriptions — error messages include specific details (MRN, provider names)
  • Backward compatibility — the legacy failure_reason field is still included

Error Response Structure

Failure events include both the legacy failure_reason field and a reasons array:
  • failure_reason (string) — concatenated description for backward compatibility
  • reasons (array) — structured error objects, each with a machine-readable code and a human-readable description

Handling Errors Programmatically

Appointment Events

Triggered when Cobalt successfully creates an appointment in your EHR via an RPA action.Payload Example:
Data Fields:
Triggered when Cobalt successfully updates an appointment in your EHR via an RPA action.Payload Example:
Data Fields:
Triggered when Cobalt fails to create an appointment in your EHR system.Payload Example:
Data Fields:Common Error Codes:
  • PATIENT_NOT_FOUND — Patient not found in EHR
  • PROVIDER_NOT_FOUND — Provider not found or invalid
  • INVALID_VISIT_TYPE — Visit type not configured in EHR
  • LOCATION_NOT_FOUND — Location/facility not found
  • TIME_SLOT_UNAVAILABLE — Requested time slot is not available
  • PROVIDER_UNAVAILABLE — Provider unavailable at requested time
  • DOUBLE_BOOKING_CONFLICT — Provider’s schedule has a conflicting visit or block at the requested time (only returned when prevent_double_booking: "true" was set on the appointment)
  • INVALID_COMPLAINT_TYPE — Chief complaint type not found
  • TERMINAL_FAILURE — Unspecified terminal failure
Triggered when Cobalt fails to update an existing appointment in your EHR system.Payload Example:
Data Fields:Common Error Codes:
  • APPOINTMENT_NOT_FOUND — Appointment not found in EHR
  • SECTION_LOCKED — Appointment section is locked
  • INVALID_STATUS — Invalid status transition
  • UPDATE_BLOCKED — Update blocked by EHR rules
  • CLAIMS_ASSOCIATED — Claims exist, update not allowed
  • UPDATE_VERIFICATION_FAILED — Update verification failed
  • TERMINAL_FAILURE — Unspecified terminal failure

Patient Events

Triggered when Cobalt successfully creates a patient in your EHR system.Payload Example:
Data Fields:
Triggered when Cobalt fails to create a patient in your EHR system.Payload Example:
Data Fields:Common Error Codes:
  • DUPLICATE_PATIENT — Patient already exists with same name/DOB
  • INVALID_DATE_OF_BIRTH — Date of birth format is invalid
  • REQUIRED_FIELD_MISSING — Required demographic field missing
  • INSURANCE_NOT_FOUND — Insurance company not found in EHR
  • INVALID_INSURANCE_POLICY_TYPE — Insurance policy type invalid
  • PCP_PROVIDER_NOT_FOUND — Primary care provider not found
  • REFERRING_PROVIDER_NOT_FOUND — Referring provider not found
  • PHARMACY_NOT_FOUND — Pharmacy not found in EHR
  • PERMISSION_DENIED — User lacks permission to create patients
  • TERMINAL_FAILURE — Unspecified terminal failure
Triggered when Cobalt applies an update to an existing patient in your EHR. Contact/address fields and provider fields are applied independently, so an update can succeed in part. failed_fields and message are present only when some requested fields could not be applied; a fully successful update omits them.Payload Example (partial update):
Data Fields:
Triggered when Cobalt could not apply any of the requested fields to an existing patient (for example, the EHR rejected every change). When at least one field is applied, a patient.updated event carrying failed_fields is sent instead.Payload Example:
Data Fields:
Triggered when Cobalt successfully adds insurance information for a patient.Payload Example:
Data Fields:audit_trail may also be present for integrations such as Experity and EZDERM. It is not currently included in the eClinicalWorks insurance success payload shown above.
Triggered when Cobalt successfully updates an existing insurance record for a patient.Payload Example:
Data Fields:
Triggered when Cobalt fails to add or update insurance information for a patient.Payload Example:
Data Fields:

Task Events

Triggered when Cobalt successfully creates a task in your EHR system.Payload Example:
Data Fields:
Triggered when Cobalt fails to create a task in your EHR system.Payload Example:
Data Fields:Common Error Codes:
  • PATIENT_NOT_FOUND — Patient MRN not found in EHR
  • ASSIGNEE_NOT_FOUND — Assigned user not found in EHR
  • INVALID_TASK_DATA — Task data validation failed
  • PERMISSION_DENIED — User lacks permission to create tasks
  • TERMINAL_FAILURE — Unspecified terminal failure

Note Events

Triggered when Cobalt successfully uploads a clinical note to your EHR system.The status field distinguishes a clean upload from a partial success, where the note body was written but one or more diagnosis (ICD) or procedure (CPT) codes could not be matched in the EHR. When codes are present, they are reported under icd_codes and cpt_codes, each split into matched and unmatched (and, for ICD, skipped).Payload Example:
Data Fields:Because the note body is written even when a code fails to match, unmatched codes are reported on note.uploaded (with status: "partial_success") rather than note.failed. Check status and the unmatched arrays if you need to reconcile coding.
Triggered when Cobalt fails to upload a clinical note to your EHR system. This fires only after retries are exhausted.Payload Example:
Data Fields:Error Codes (eClinicalWorks):
  • UNSUPPORTED_CHARACTERS — The note text contains characters the EHR cannot accept
  • MAX_ATTEMPTS_EXCEEDED — Note creation failed after all retry attempts
  • UNKNOWN_ERROR — An unexpected error occurred

Document Events

Triggered when Cobalt successfully uploads a document to your EHR system.Payload Example:
Data Fields:
Triggered when Cobalt fails to upload a document to your EHR system.Payload Example:
Data Fields:Common Error Codes:
  • PATIENT_NOT_FOUND — Patient not found in EHR
  • DOCUMENT_CLASS_NOT_FOUND — Document folder/category not found
  • INVALID_DOCUMENT_CONTENT — Document content is invalid
  • DOCUMENT_UPLOAD_FAILED — Upload failed for unspecified reason
  • UNKNOWN_ERROR — Unexpected error occurred
Triggered when Cobalt fails to upload a document to eClinicalWorks specifically.Payload Example:
Data Fields:Common Error Codes:
  • PATIENT_NOT_FOUND — Patient not found in EHR
  • DOCUMENT_CLASS_NOT_FOUND — Document folder/category not found
  • UNKNOWN_ERROR — Unexpected error occurred during upload

Message Events

Triggered when Cobalt successfully creates a message in your EHR system.Payload Example:
Data Fields:
Triggered when Cobalt fails to create a message in your EHR system.Payload Example:
Data Fields:Common Error Codes:
  • MESSAGE_SEND_FAILED — Message failed to send
  • PROVIDER_NOT_FOUND — Provider not found in EHR
  • INVALID_MESSAGE_CONTENT — Message content validation failed
  • MESSAGE_TOO_LONG — Message exceeds maximum length
  • TERMINAL_FAILURE — Unspecified terminal failure

Telephone Encounter Events

Triggered when Cobalt successfully creates a telephone encounter in your EHR system.Payload Example:
Data Fields:
Triggered when Cobalt creates a telephone encounter successfully but a requested medication refill could not be added.Payload Example:
Data Fields:
The encounter itself was created successfully — only the medication refill portion failed. Follow up manually to add the refill or notify the requester.
Triggered when Cobalt fails to create a telephone encounter in your EHR system.Payload Example:
Data Fields:
Triggered when Cobalt successfully adds an action (note/update) to an existing telephone encounter.Payload Example:
Data Fields:
Triggered when Cobalt fails to add an action to a telephone encounter.Payload Example:
Data Fields:

Test Event

A test event used to verify webhook delivery and integration setup. Trigger it manually using the Send Test Webhook endpoint (POST /v1/webhook/test).Payload Example:
Data Fields:Triggering a Test Event:
The test event is sent to all configured webhook URLs for your client. Use it to verify your endpoint is receiving events, your signature verification logic works, and your event processing pipeline is healthy.
You must have at least one webhook URL configured (POST /v1/webhook) before sending a test event.