Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.usecobalt.com/llms.txt

Use this file to discover all available pages before exploring further.

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) 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:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "access_token_reference_id": "your-reference-id",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "appointment.created",
  "job_id": "12345",
  "data": {
    // Event-specific payload
  }
}
FieldTypeDescription
idstringUnique identifier for this event
access_token_reference_idstringYour reference ID associated with this webhook
objectstringAlways "event"
createdstringISO 8601 timestamp when the event was created
typestringThe event type
job_idstringAPI log ID for tracking the operation
dataobjectEvent-specific data payload

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:
{
  "type": "appointment.failed",
  "data": {
    "appointment_id": "abc123def456",
    "mrn": "MRN123456",
    "failure_reason": "Patient MRN 'MRN123456' not found. Please update the MRN...",
    "reasons": [
      {
        "code": "PATIENT_NOT_FOUND",
        "description": "Patient MRN 'MRN123456' not found. Please update the MRN using the PATCH /v1/appointments/:id endpoint."
      }
    ]
  }
}
  • 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

function handleAppointmentFailed(webhookData) {
  const reasons = webhookData.data.reasons || [];

  for (const reason of reasons) {
    switch (reason.code) {
      case 'PATIENT_NOT_FOUND':
        updatePatientMrn(webhookData.data.mrn);
        break;
      case 'PROVIDER_UNAVAILABLE':
        findAlternativeSlots(webhookData.data.appointment_id);
        break;
      case 'INVALID_VISIT_TYPE':
        mapVisitType(webhookData.data.appointment_id);
        break;
      default:
        alertSupport(reason);
    }
  }
}

Appointment Events

Triggered when Cobalt successfully creates an appointment in your EHR via an RPA action.Payload Example:
{
  "id": "759df7ac-2688-44a9-926c-58d36376b412",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-07-28T16:05:48.929Z",
  "type": "appointment.created",
  "job_id": "12345",
  "data": {
    "appointment_id": "c5c0e613fc7d68a1c01ef4160483a0b6",
    "mrn": "44235",
    "date_time": "2025-07-28T16:00:00.000Z",
    "timezone": "America/New_York",
    "provider_id": "defe69ae-f363-4797-87bd-1c70acb52b21",
    "provider_name": "Dr. Jose Gonzalez",
    "secondary_provider_id": null
  }
}
Data Fields:
FieldTypeDescription
appointment_idstringCobalt’s unique identifier for the appointment
mrnstringPatient’s Medical Record Number
date_timestringAppointment date and time (ISO 8601)
timezonestringTimezone for the appointment
provider_idstringPrimary provider’s ID
provider_namestringPrimary provider’s name
secondary_provider_idstring | nullSecondary provider’s ID (if applicable)
Triggered when Cobalt successfully updates an appointment in your EHR via an RPA action.Payload Example:
{
  "id": "508c368e7de13b40f9397eec966d0329",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-07-28T08:50:42.491-07:00",
  "type": "appointment.updated",
  "job_id": "12345",
  "data": {
    "id": "0551c88b2249945151f967525ee3f7b4",
    "ehr_appointment_id": "482129",
    "patient_mrn": "804",
    "patient_name": "John Doe",
    "datetime": "2025-07-28T16:00:00.000Z",
    "duration": 20,
    "location": "2",
    "status": "2",
    "provider_name": "Dr. Michael Denenberg",
    "appointment_type": "FOLLOW-UP",
    "appointment_mode": "office",
    "updated_fields": {
      "status": "2"
    }
  }
}
Data Fields:
FieldTypeDescription
idstringCobalt’s unique identifier for the appointment
ehr_appointment_idstringThe EHR’s native appointment ID
patient_mrnstringPatient’s Medical Record Number
patient_namestringPatient’s full name
datetimestringAppointment date and time (ISO 8601)
durationnumberAppointment duration in minutes
locationstringAppointment location/room
statusstringAppointment status code
provider_namestringProvider’s name
appointment_typestringType of appointment
appointment_modestringMode (e.g., “office”, “telehealth”)
updated_fieldsobjectFields that changed in this update
Triggered when Cobalt fails to create an appointment in your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "appointment.failed",
  "job_id": "12345",
  "data": {
    "appointment_id": "abc123def456",
    "mrn": "MRN123456",
    "failure_reason": "Patient MRN 'MRN123456' not found. Please update the MRN using the PATCH /v1/appointments/:id endpoint.",
    "reasons": [
      {
        "code": "PATIENT_NOT_FOUND",
        "description": "Patient MRN 'MRN123456' not found. Please update the MRN using the PATCH /v1/appointments/:id endpoint."
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
appointment_idstringCobalt’s identifier for the failed appointment
mrnstringPatient’s Medical Record Number
failure_reasonstringLegacy human-readable error message
reasonsarrayStructured error objects with code and description
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
  • 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:
{
  "id": "550e8400-e29b-41d4-a716-446655440001",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "appointment.update_failed",
  "job_id": "12345",
  "data": {
    "appointment_id": "abc123def456",
    "mrn": "MRN123456",
    "failure_reason": "Appointment not found in EHR. The appointment may have been deleted or moved.",
    "reasons": [
      {
        "code": "APPOINTMENT_NOT_FOUND",
        "description": "Appointment not found in EHR. The appointment may have been deleted or moved."
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
appointment_idstringCobalt’s identifier for the appointment
mrnstringPatient’s Medical Record Number
failure_reasonstringLegacy human-readable error message
reasonsarrayStructured error objects with code and description
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:
{
  "id": "550e8400-e29b-41d4-a716-446655440010",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "patient.created",
  "job_id": "12345",
  "data": {
    "patient_id": "xyz789uvw012",
    "mrn": "MRN123456",
    "first_name": "Jane",
    "last_name": "Smith",
    "date_of_birth": "1985-06-15",
    "sex": "F",
    "email": "jane.smith@example.com",
    "phone": "555-0123"
  }
}
Data Fields:
FieldTypeDescription
patient_idstringCobalt’s unique identifier for the patient
mrnstringPatient’s Medical Record Number
first_namestringPatient’s first name
last_namestringPatient’s last name
date_of_birthstringPatient’s date of birth (YYYY-MM-DD)
sexstringPatient’s sex
emailstringPatient’s email address
phonestringPatient’s phone number
Triggered when Cobalt fails to create a patient in your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440002",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "patient.failed",
  "job_id": "12345",
  "data": {
    "patient_id": "xyz789uvw012",
    "failure_reason": "Patient already exists with MRN 'MRN789456'.",
    "reasons": [
      {
        "code": "DUPLICATE_PATIENT",
        "description": "Patient already exists with MRN 'MRN789456'. Please update the patient information using the PATCH /v1/patients/:id endpoint or search using GET /v1/patients."
      }
    ],
    "existing_mrn": "MRN789456"
  }
}
Data Fields:
FieldTypeDescription
patient_idstringCobalt’s identifier for the failed patient creation
failure_reasonstringLegacy human-readable error message
reasonsarrayStructured error objects with code and description
existing_mrnstringMRN of existing patient (for duplicate errors)
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 successfully adds insurance information for a patient.Payload Example:
{
  "id": "evt_abc123def456",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-01-15T10:30:00.000Z",
  "type": "patient.insurance.added",
  "job_id": "12345",
  "data": {
    "patient_insurance_id": "xyz789abc123",
    "patient_mrn": "MRN123456",
    "member_id": "MEM123456789",
    "group_id": "GRP98999",
    "plan_begin_date": "2025-01-01",
    "copayment": 25,
    "audit_trail": [
      {
        "field_label": "Insurance Company",
        "before": "",
        "after": "AHMC Health",
        "property": "insurance_company"
      },
      {
        "field_label": "Member ID",
        "before": "",
        "after": "MEM123456789",
        "property": "member_id"
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
patient_insurance_idstringCobalt’s unique identifier for the insurance record
patient_mrnstringPatient’s Medical Record Number
member_idstringInsurance member ID
group_idstringInsurance group ID
plan_begin_datestringInsurance plan start date (YYYY-MM-DD)
copaymentnumberCopayment amount
audit_trailarrayList of fields modified in the EHR with before/after values
Triggered when Cobalt fails to add insurance information for a patient.Payload Example:
{
  "id": "evt_xyz789abc123",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-01-15T10:30:00.000Z",
  "type": "patient.insurance.failed",
  "job_id": "12345",
  "data": {
    "patient_insurance_id": "xyz789abc123",
    "patient_mrn": "MRN123456",
    "error": "Patient not found in EMR system"
  }
}
Data Fields:
FieldTypeDescription
patient_insurance_idstringCobalt’s identifier for the insurance record
patient_mrnstringPatient’s Medical Record Number
errorstringHuman-readable explanation of why the insurance addition failed

Task Events

Triggered when Cobalt successfully creates a task in your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440011",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "task.created",
  "job_id": "12345",
  "data": {
    "task_id": "task123def456",
    "emr_task_id": "EMR-TASK-789",
    "subject": "Follow up with patient",
    "description": "Call patient regarding lab results",
    "assignee_user_id": "user-456",
    "patient_mrn": "MRN123456"
  }
}
Data Fields:
FieldTypeDescription
task_idstringCobalt’s unique identifier for the task
emr_task_idstringThe EHR’s native task ID
subjectstringTask subject/title
descriptionstringDetailed task description
assignee_user_idstringID of the user assigned to the task
patient_mrnstringPatient’s Medical Record Number (if applicable)
Triggered when Cobalt fails to create a task in your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440012",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "task.failed",
  "job_id": "12345",
  "data": {
    "task_id": "task123def456",
    "failure_reason": "Patient MRN 'MRN123456' not found.",
    "reasons": [
      {
        "code": "PATIENT_NOT_FOUND",
        "description": "Patient MRN 'MRN123456' not found. Please update the patient MRN using the PATCH /v1/tasks/:id endpoint."
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
task_idstringCobalt’s identifier for the failed task
failure_reasonstringLegacy human-readable error message
reasonsarrayStructured error objects with code and description
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.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440013",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "note.uploaded",
  "data": {
    "appointment_id": "abc123def456",
    "patient_mrn": "MRN123456",
    "note_type": "Progress Note",
    "provider_name": "Dr. Sarah Johnson"
  }
}
Data Fields:
FieldTypeDescription
appointment_idstringCobalt’s appointment identifier
patient_mrnstringPatient’s Medical Record Number
note_typestringType of clinical note uploaded
provider_namestringName of the provider who authored the note
Triggered when Cobalt fails to upload a clinical note to your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440003",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "note.failed",
  "data": {
    "appointment_id": "abc123def456",
    "timezone": "America/New_York",
    "mrn": "MRN123456",
    "reasons": [
      {
        "code": "SECTION_NOT_FOUND",
        "description": "Failed to find the HPI section. Please ensure the note template has the required sections."
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
appointment_idstringCobalt’s appointment identifier
timezonestringTimezone for the appointment
mrnstringPatient’s Medical Record Number
reasonsarrayList of error objects with code and description
Common Error Codes:
  • SECTION_NOT_FOUND — Required note section not found in template
  • PATIENT_NOT_FOUND — Patient not found in EHR
  • APPOINTMENT_NOT_FOUND — Appointment not found in EHR
  • UNKNOWN_ERROR — Unexpected error occurred

Document Events

Triggered when Cobalt successfully uploads a document to your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440004",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "document.uploaded",
  "data": {
    "document_id": "doc123456",
    "patient_mrn": "MRN123456",
    "folder_name": "Lab Results"
  }
}
Data Fields:
FieldTypeDescription
document_idstringCobalt’s unique identifier for the document
patient_mrnstringPatient’s Medical Record Number
folder_namestringEHR folder/category where document was uploaded
Triggered when Cobalt fails to upload a document to your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440005",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "document.failed",
  "data": {
    "document_id": "doc123456",
    "patient_mrn": "MRN123456",
    "folder_name": "Lab Results",
    "reasons": [
      {
        "code": "PATIENT_NOT_FOUND",
        "description": "Failed to find a patient with the given mrn."
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
document_idstringCobalt’s identifier for the document
patient_mrnstringPatient’s Medical Record Number
folder_namestringTarget EHR folder/category
reasonsarrayList of error objects with code and description
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:
{
  "id": "550e8400-e29b-41d4-a716-446655440006",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "document.upload_failed",
  "data": {
    "document_id": "doc123456",
    "patient_mrn": "MRN123456",
    "folder_name": "Lab Results",
    "failure_reason": "Document class 'Lab Results' not found in eClinicalWorks. Please verify the folder name.",
    "reasons": [
      {
        "code": "DOCUMENT_CLASS_NOT_FOUND",
        "description": "Document class 'Lab Results' not found in eClinicalWorks. Please verify the folder name."
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
document_idstringCobalt’s identifier for the document
patient_mrnstringPatient’s Medical Record Number
folder_namestringTarget EHR folder/category
failure_reasonstringLegacy human-readable error message
reasonsarrayStructured error objects with code and description
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:
{
  "id": "550e8400-e29b-41d4-a716-446655440007",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "message.created",
  "job_id": "12345",
  "data": {
    "message_id": "msg123def456",
    "provider_id": "provider-789",
    "subject": "Patient Follow-up"
  }
}
Data Fields:
FieldTypeDescription
message_idstringCobalt’s unique identifier for the message
provider_idstringID of the provider who received the message
subjectstringMessage subject line
Triggered when Cobalt fails to create a message in your EHR system.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440008",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "message.failed",
  "job_id": "12345",
  "data": {
    "message_id": "msg123def456",
    "provider_id": "provider-789",
    "failure_reason": "Failed to send message. Please try again or contact support if the issue persists.",
    "reasons": [
      {
        "code": "MESSAGE_SEND_FAILED",
        "description": "Failed to send message. Please try again or contact support if the issue persists."
      }
    ]
  }
}
Data Fields:
FieldTypeDescription
message_idstringCobalt’s identifier for the message
provider_idstringID of the target provider
failure_reasonstringLegacy human-readable error message
reasonsarrayStructured error objects with code and description
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:
{
  "id": "550e8400-e29b-41d4-a716-446655440020",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "telephone_encounter.created",
  "job_id": "12345",
  "data": {
    "telephone_encounter_id": "abc123def456",
    "emr_encounter_id": "EMR-ENC-789",
    "patient_mrn": "MRN123456",
    "provider_id": "provider-456",
    "location_id": "location-789",
    "assigned_to_id": "user-101",
    "reason": "Medication refill request",
    "refill_medication_name": "Lisinopril 10mg"
  }
}
Data Fields:
FieldTypeDescription
telephone_encounter_idstringCobalt’s unique identifier for the telephone encounter
emr_encounter_idstringThe EHR’s native encounter ID
patient_mrnstringPatient’s Medical Record Number
provider_idstringEHR provider ID
location_idstringEHR location ID
assigned_to_idstringEHR user ID the encounter is assigned to
reasonstring | nullReason for the telephone encounter
refill_medication_namestringMedication name (only present when a refill was requested and added successfully)
Triggered when Cobalt creates a telephone encounter successfully but a requested medication refill could not be added.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440021",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "telephone_encounter.created_partial",
  "job_id": "12345",
  "data": {
    "telephone_encounter_id": "abc123def456",
    "emr_encounter_id": "EMR-ENC-789",
    "patient_mrn": "MRN123456",
    "provider_id": "provider-456",
    "location_id": "location-789",
    "assigned_to_id": "user-101",
    "reason": "Medication refill request",
    "refill_medication_name": "Lisinopril 10mg",
    "refill_failure_reason": "Medication not found in patient's active medication list"
  }
}
Data Fields:
FieldTypeDescription
telephone_encounter_idstringCobalt’s unique identifier for the telephone encounter
emr_encounter_idstringThe EHR’s native encounter ID
patient_mrnstringPatient’s Medical Record Number
provider_idstringEHR provider ID
location_idstringEHR location ID
assigned_to_idstringEHR user ID the encounter is assigned to
reasonstring | nullReason for the telephone encounter
refill_medication_namestringRequested medication name
refill_failure_reasonstringWhy the medication refill could not be added
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:
{
  "id": "550e8400-e29b-41d4-a716-446655440022",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "telephone_encounter.failed",
  "job_id": "12345",
  "data": {
    "telephone_encounter_id": "abc123def456",
    "patient_mrn": "MRN123456",
    "refill_medication_name": "Lisinopril 10mg",
    "failure_reason": "Unable to create telephone encounter: Provider license has expired in eCW. Please update the provider license and try again."
  }
}
Data Fields:
FieldTypeDescription
telephone_encounter_idstringCobalt’s identifier for the failed telephone encounter
patient_mrnstring | nullPatient’s Medical Record Number
refill_medication_namestring | nullRequested medication name (if a refill was requested)
failure_reasonstringDetailed explanation of why the telephone encounter creation failed
Triggered when Cobalt successfully adds an action (note/update) to an existing telephone encounter.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440023",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "telephone_encounter_action.created",
  "job_id": "12345",
  "data": {
    "action_id": "act123def456",
    "emr_appointment_id": "EMR-ENC-789",
    "text": "Spoke with patient — refill approved by Dr. Smith. Patient instructed to pick up at preferred pharmacy."
  }
}
Data Fields:
FieldTypeDescription
action_idstringCobalt’s unique identifier for the action
emr_appointment_idstringThe EHR’s encounter/appointment ID the action was added to
textstringThe action text/note that was added
Triggered when Cobalt fails to add an action to a telephone encounter.Payload Example:
{
  "id": "550e8400-e29b-41d4-a716-446655440024",
  "access_token_reference_id": "clinic_1",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "telephone_encounter_action.failed",
  "job_id": "12345",
  "data": {
    "action_id": "act123def456",
    "emr_appointment_id": "EMR-ENC-789",
    "failure_reason": "ECW API returned non-success status: failure. Error: Encounter is locked"
  }
}
Data Fields:
FieldTypeDescription
action_idstringCobalt’s identifier for the action
emr_appointment_idstring | nullThe EHR’s encounter/appointment ID the action targeted
failure_reasonstringDetailed explanation of why the action failed

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:
{
  "id": "test-event-1703172600000",
  "access_token_reference_id": "your-reference-id",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "test.event",
  "data": {
    "message": "This is a test webhook event",
    "timestamp": "2025-10-21T14:30:00.000Z"
  }
}
Data Fields:
FieldTypeDescription
messagestringTest message content
timestampstringWhen the test event was generated
Triggering a Test Event:
curl -X POST https://api.cobalt.run/v1/webhook/test \
  -H "client_id: YOUR_CLIENT_ID" \
  -H "client_secret: YOUR_CLIENT_SECRET" \
  -H "access_token: YOUR_ACCESS_TOKEN"
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.