Event Categories
Webhook events are organized into two main categories based on how they’re triggered:- Operation Events
- Sync Events
Operation events are sent when Cobalt performs an RPA (Robotic Process Automation) action inside your EHR system. These confirm the success or failure of operations that Cobalt initiated on your behalf.Examples include creating appointments, adding patient insurance, uploading notes, and creating tasks.
The specific events available to you depend on your Cobalt configuration and EHR system. Contact your Cobalt representative to enable specific event types.
Event Structure
All webhook events share a common structure:| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for this event |
access_token_reference_id | string | Your reference ID associated with this webhook |
object | string | Always "event" |
created | string | ISO 8601 timestamp when the event was created |
type | string | The event type (e.g., appointment.created) |
job_id | string | Optional API log ID for tracking the operation |
data | object | Event-specific data payload |
Structured Error Codes
Failure events (e.g.,appointment.failed, patient.failed) now include structured error codes to help you programmatically handle different failure scenarios. This feature provides:
- Machine-readable error codes - Parse errors programmatically instead of string matching
- Context-aware descriptions - Error messages include specific details (MRN, provider names, etc.)
- Backward compatibility - The legacy
failure_reasonfield is still included
Error Response Structure
Failure events include both the legacyfailure_reason field and a new reasons array:
failure_reason(string) - Human-readable error message for backward compatibilityreasons(array) - List of structured error objects, each containing:code(string) - Machine-readable error codedescription(string) - Context-aware human-readable description
The
failure_reason field is a concatenation of all description values from the reasons array, maintained for backward compatibility.Using Structured Error Codes
You can programmatically handle different failure scenarios by checking thecode field in the reasons array:
Migration from Legacy Error Handling
If you’re currently usingfailure_reason string matching, you can gradually migrate to structured error codes:
Before (legacy approach):
Event Types Reference
Appointment Events
appointment.created
appointment.created
Triggered when Cobalt successfully creates an appointment in your EHR system, or when your staff creates an appointment (sync event).Type: Operation & SyncPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
appointment_id | string | Cobalt’s unique identifier for the appointment |
mrn | string | Patient’s Medical Record Number |
date_time | string | Appointment date and time (ISO 8601) |
timezone | string | Timezone for the appointment |
provider_id | string | Primary provider’s ID |
provider_name | string | Primary provider’s name |
secondary_provider_id | string | null | Secondary provider’s ID (if applicable) |
appointment.updated
appointment.updated
Triggered when an appointment is updated in your EHR system, either by Cobalt or by your staff (sync event).Type: Operation & SyncPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
id | string | Cobalt’s unique identifier for the appointment |
ehr_appointment_id | string | The EHR’s native appointment ID |
patient_mrn | string | Patient’s Medical Record Number |
patient_name | string | Patient’s full name |
datetime | string | Appointment date and time (ISO 8601) |
duration | number | Appointment duration in minutes |
location | string | Appointment location/room |
status | string | Appointment status code |
provider_name | string | Provider’s name |
appointment_type | string | Type of appointment |
appointment_mode | string | Mode (e.g., “office”, “telehealth”) |
updated_fields | object | Fields that changed in this update |
appointment.failed
appointment.failed
Triggered when Cobalt fails to create an appointment in your EHR system.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
appointment_id | string | Cobalt’s identifier for the failed appointment |
mrn | string | Patient’s Medical Record Number |
failure_reason | string | Detailed explanation (legacy field, use reasons for new integrations) |
reasons | array | Structured error objects with code and description |
PATIENT_NOT_FOUND- Patient not found in EHRPROVIDER_NOT_FOUND- Provider not found or invalidINVALID_VISIT_TYPE- Visit type not configured in EHRLOCATION_NOT_FOUND- Location/facility not foundTIME_SLOT_UNAVAILABLE- Requested time slot is not availablePROVIDER_UNAVAILABLE- Provider unavailable at requested timeINVALID_COMPLAINT_TYPE- Chief complaint type not foundTERMINAL_FAILURE- Unspecified terminal failure
appointment.update_failed
appointment.update_failed
Triggered when Cobalt fails to update an existing appointment in your EHR system.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
appointment_id | string | Cobalt’s identifier for the appointment |
mrn | string | Patient’s Medical Record Number |
failure_reason | string | Detailed explanation (legacy field, use reasons for new integrations) |
reasons | array | Structured error objects with code and description |
APPOINTMENT_NOT_FOUND- Appointment not found in EHRSECTION_LOCKED- Appointment section is lockedINVALID_STATUS- Invalid status transitionUPDATE_BLOCKED- Update blocked by EHR rulesCLAIMS_ASSOCIATED- Claims exist, update not allowedUPDATE_VERIFICATION_FAILED- Update verification failedTERMINAL_FAILURE- Unspecified terminal failure
appointment.status_updated
appointment.status_updated
Triggered when an appointment’s status changes in your EHR system (sync event only).Type: SyncPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
id | string | Cobalt’s unique identifier for the appointment |
ehr_appointment_id | string | The EHR’s native appointment ID |
patient_mrn | string | Patient’s Medical Record Number |
patient_name | string | Patient’s full name |
datetime | string | Appointment date and time (ISO 8601) |
status | string | New appointment status |
previous_status | string | Previous appointment status |
provider_name | string | Provider’s name |
Patient Events
patient.created
patient.created
Triggered when Cobalt successfully creates a patient in your EHR system.Type: OperationPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
patient_id | string | Cobalt’s unique identifier for the patient |
mrn | string | Patient’s Medical Record Number |
first_name | string | Patient’s first name |
last_name | string | Patient’s last name |
date_of_birth | string | Patient’s date of birth (YYYY-MM-DD) |
sex | string | Patient’s sex |
email | string | Patient’s email address |
phone | string | Patient’s phone number |
patient.updated
patient.updated
Triggered when patient information is updated in your EHR system (sync event only).Type: SyncPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
mrn | string | Patient’s Medical Record Number |
patient_name | string | Patient’s full name |
updated_fields | object | Fields that changed in this update |
patient.failed
patient.failed
Triggered when Cobalt fails to create a patient in your EHR system.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
patient_id | string | Cobalt’s identifier for the failed patient creation |
failure_reason | string | Detailed explanation (legacy field, use reasons for new integrations) |
reasons | array | Structured error objects with code and description |
existing_mrn | string | MRN of existing patient (for duplicate errors) |
DUPLICATE_PATIENT- Patient already exists with same name/DOBINVALID_DATE_OF_BIRTH- Date of birth format is invalidREQUIRED_FIELD_MISSING- Required demographic field missingINSURANCE_NOT_FOUND- Insurance company not found in EHRINVALID_INSURANCE_POLICY_TYPE- Insurance policy type invalidPCP_PROVIDER_NOT_FOUND- Primary care provider not foundREFERRING_PROVIDER_NOT_FOUND- Referring provider not foundPHARMACY_NOT_FOUND- Pharmacy not found in EHRPERMISSION_DENIED- User lacks permission to create patientsTERMINAL_FAILURE- Unspecified terminal failure
patient.insurance.added
patient.insurance.added
Triggered when Cobalt successfully adds insurance information for a patient in your EHR system.Type: OperationPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
patient_insurance_id | string | Cobalt’s unique identifier for the insurance record |
patient_mrn | string | Patient’s Medical Record Number |
member_id | string | Insurance member ID |
group_id | string | Insurance group ID |
plan_begin_date | string | Insurance plan start date (YYYY-MM-DD) |
copayment | number | Copayment amount |
audit_trail | array | List of fields modified in the EHR |
The
audit_trail array shows all fields that were modified in the EMR during the insurance addition process, including before and after values.patient.insurance.failed
patient.insurance.failed
Triggered when Cobalt fails to add insurance information for a patient in your EHR system.Type: OperationPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
patient_insurance_id | string | Cobalt’s identifier for the insurance record |
patient_mrn | string | Patient’s Medical Record Number |
error | string | Detailed explanation of why the insurance addition failed |
Task Events
task.created
task.created
Triggered when Cobalt successfully creates a task in your EHR system.Type: OperationPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
task_id | string | Cobalt’s unique identifier for the task |
emr_task_id | string | The EHR’s native task ID |
subject | string | Task subject/title |
description | string | Detailed task description |
assignee_user_id | string | ID of the user assigned to the task |
patient_mrn | string | Patient’s Medical Record Number (if applicable) |
task.failed
task.failed
Triggered when Cobalt fails to create a task in your EHR system.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
task_id | string | Cobalt’s identifier for the failed task |
failure_reason | string | Detailed explanation (legacy field, use reasons for new integrations) |
reasons | array | Structured error objects with code and description |
PATIENT_NOT_FOUND- Patient MRN not found in EHRASSIGNEE_NOT_FOUND- Assigned user not found in EHRINVALID_TASK_DATA- Task data validation failedPERMISSION_DENIED- User lacks permission to create tasksTERMINAL_FAILURE- Unspecified terminal failure
Note Events
note.uploaded
note.uploaded
Triggered when Cobalt successfully uploads a clinical note to your EHR system.Type: OperationPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
appointment_id | string | Cobalt’s appointment identifier |
patient_mrn | string | Patient’s Medical Record Number |
note_type | string | Type of clinical note uploaded |
provider_name | string | Name of the provider who authored the note |
note.failed
note.failed
Triggered when Cobalt fails to upload a clinical note to your EHR system.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
appointment_id | string | Cobalt’s appointment identifier |
timezone | string | Timezone for the appointment |
mrn | string | Patient’s Medical Record Number |
reasons | array | List of error objects with code and description |
SECTION_NOT_FOUND- Required note section not found in templatePATIENT_NOT_FOUND- Patient not found in EHRAPPOINTMENT_NOT_FOUND- Appointment not found in EHRUNKNOWN_ERROR- Unexpected error occurred
Document Events
document.uploaded
document.uploaded
Triggered when Cobalt successfully uploads a document to your EHR system.Type: OperationPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
document_id | string | Cobalt’s unique identifier for the document |
patient_mrn | string | Patient’s Medical Record Number |
folder_name | string | EHR folder/category where document was uploaded |
document.failed
document.failed
Triggered when Cobalt fails to upload a document to your EHR system.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
document_id | string | Cobalt’s identifier for the document |
patient_mrn | string | Patient’s Medical Record Number |
folder_name | string | Target EHR folder/category |
reasons | array | List of error objects with code and description |
PATIENT_NOT_FOUND- Patient not found in EHRDOCUMENT_CLASS_NOT_FOUND- Document folder/category not foundINVALID_DOCUMENT_CONTENT- Document content is invalidDOCUMENT_UPLOAD_FAILED- Upload failed for unspecified reasonUNKNOWN_ERROR- Unexpected error occurred
document.upload_failed
document.upload_failed
Triggered when Cobalt fails to upload a document to eClinicalWorks specifically.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
document_id | string | Cobalt’s identifier for the document |
patient_mrn | string | Patient’s Medical Record Number |
folder_name | string | Target EHR folder/category |
failure_reason | string | Detailed explanation (legacy field, use reasons for new integrations) |
reasons | array | Structured error objects with code and description |
PATIENT_NOT_FOUND- Patient not found in EHRDOCUMENT_CLASS_NOT_FOUND- Document folder/category not foundUNKNOWN_ERROR- Unexpected error occurred during upload
Message Events
message.created
message.created
Triggered when Cobalt successfully creates a message in your EHR system.Type: OperationPayload Example:Data Fields:
| Field | Type | Description |
|---|---|---|
message_id | string | Cobalt’s unique identifier for the message |
provider_id | string | ID of the provider who received the message |
subject | string | Message subject line |
message.failed
message.failed
Triggered when Cobalt fails to create a message in your EHR system.Type: OperationPayload Example:Data Fields:
Common Error Codes:
| Field | Type | Description |
|---|---|---|
message_id | string | Cobalt’s identifier for the message |
provider_id | string | ID of the target provider |
failure_reason | string | Detailed explanation (legacy field, use reasons for new integrations) |
reasons | array | Structured error objects with code and description |
MESSAGE_SEND_FAILED- Message failed to sendPROVIDER_NOT_FOUND- Provider not found in EHRINVALID_MESSAGE_CONTENT- Message content validation failedMESSAGE_TOO_LONG- Message exceeds maximum lengthTERMINAL_FAILURE- Unspecified terminal failure
Testing Events
test.event
test.event
A test event used to verify webhook delivery and integration setup. You can trigger this event manually using the Send Test Webhook endpoint (POST /v1/webhook/test).Type: TestingPayload Example:Data Fields:
How to Use:Send a POST request to The test event will be sent to all configured webhook URLs for your client. Use this to:
| Field | Type | Description |
|---|---|---|
message | string | Test message content |
timestamp | string | When the test event was generated |
/v1/webhook/test with your authentication headers to trigger a test webhook:- Verify your webhook endpoint is receiving events correctly
- Test your webhook signature verification logic
- Validate your event processing pipeline
- Debug webhook delivery issues
You must have at least one webhook URL configured using
POST /v1/webhook before sending a test event.Event Types Quick Reference
| Event Type | Category | Operation | Sync | Description |
|---|---|---|---|---|
appointment.created | Appointments | ✓ | ✓ | Appointment created |
appointment.updated | Appointments | ✓ | ✓ | Appointment updated |
appointment.failed | Appointments | ✓ | Appointment creation failed | |
appointment.update_failed | Appointments | ✓ | Appointment update failed | |
appointment.status_updated | Appointments | ✓ | Appointment status changed | |
patient.created | Patients | ✓ | Patient created | |
patient.updated | Patients | ✓ | Patient information updated | |
patient.failed | Patients | ✓ | Patient creation failed | |
patient.insurance.added | Patients | ✓ | Insurance added successfully | |
patient.insurance.failed | Patients | ✓ | Insurance addition failed | |
task.created | Tasks | ✓ | Task created | |
task.failed | Tasks | ✓ | Task creation failed | |
note.uploaded | Notes | ✓ | Clinical note uploaded | |
note.failed | Notes | ✓ | Note upload failed | |
document.uploaded | Documents | ✓ | Document uploaded | |
document.failed | Documents | ✓ | Document upload failed | |
document.upload_failed | Documents | ✓ | Document upload failed (eCW) | |
message.created | Messages | ✓ | Message created | |
message.failed | Messages | ✓ | Message creation failed | |
test.event | Testing | - | - | Test webhook delivery |
Retrieving Webhook Events
You can retrieve past webhook events programmatically using the Get Webhook Events endpoint. This is useful for:- Debugging webhook delivery issues
- Auditing event history
- Recovering from webhook delivery failures
- Testing your integration
Best Practices
Handle Idempotently
Webhook events may be delivered more than once. Use the
id field to track which events you’ve already processed.Respond Quickly
Return a 2xx status code as soon as you receive the webhook. Process the event asynchronously to avoid timeouts.
Verify Signatures
Always verify the
cobalt-verification header to ensure the webhook came from Cobalt. See Receiving Webhooks for details.Handle Failures
Monitor for
.failed events and implement retry logic or alerting to handle operation failures gracefully.