Webhook Guide

This document outlines the webhook system for the Azodha platform, detailing supported configurations and events.

Webhook Configuration

Before accessing Azodha services, you need to set up a webhook configuration in our system. This is done through our Webhook Configuration API.

Add Webhook Configuration

post

Adds a new webhook configuration

Body
idnumberRequired
namestringRequired
attributesobjectOptional
organizationIdnumberOptional
secretstringOptional
urlstringOptional
headersobjectOptional
eventNamestringOptional
eventIdnumberOptional
versionnumberOptional
activebooleanOptional
isDeletedbooleanOptional
Responses
200Success
application/json
post
/external-events/
200Success

Configuration Structure

  • organizationId: Your unique organization identifier

  • secret: Autogenerated secret for webhook authentication

  • attributes: Additional metadata (API key, organization code)

  • webhookEventId: Identifier for the type of event

  • name: Descriptive name for the webhook

  • url: Endpoint where webhook data will be sent

  • active: Boolean to enable/disable the webhook

  • sendOrganizationCode: Option to include organization code in payload

For additional information on the same you can review our API reference for external events

Supported Webhook Events

Azodha supports the following webhook events:

  1. AppointmentToCareTaskActivityLog

  2. InferenceToObservations

  3. InferenceToKeyFindings

  4. AssessmentResponseToWellbeingScore

  5. BookAppointment

  6. InferenceToCareTasks

  7. HealthRecordCounter

  8. Notification

  9. HealthProgramActivated

  10. UploadedFileAndTest

  11. SurveyAssessment

  12. OpenTele

Event Details

1. AppointmentToCareTaskActivityLog

Triggers when an appointment is created or updated, generating a care task activity log.

Sample payload:

2. InferenceToObservations

Parses uploaded PDF data, sends it to an LLM for inference, and returns observations.

Sample Header:

Sample payload:

Key Parameters:

  • fileId: Unique identifier for the file, including the organization ID prefix.

  • mimeType: File type (currently only "application/pdf" is supported).

  • event: Set to "InferenceToObservations" for this process.

  • useCaseName: Specifies the context for inference.

  • data: Additional metadata relevant to the inference process.

  • model: Specifies the LLM to be used for inference.

  • prompts: Array of prompt objects, each containing:

    • promptId: Unique identifier for the prompt.

    • text: The actual prompt text for the LLM.

    • expectedOutputFormat: Format specification for the output (if applicable).

3. InferenceToKeyFindings

Analyses medical data and returns key findings.

Sample Header:

Sample payload:

Key Components:

  1. inputData: Contains information about files (e.g., blood tests, body scans), survey responses, and observation codes.

  2. event: Specifies the event type as "InferenceToKeyFindings".

  3. data: Includes patient-specific information such as patientId, carePlanId, and preferred language.

  4. useCaseName: Indicates the purpose as "Key Findings Generation".

  5. model: Specifies the AI model to be used for inference.

  6. prompts: Contains the prompts for generating key findings across various health aspects.

4. AssessmentResponseToWellbeingScore

Calculates a wellbeing score based on assessment responses.

Sample payload:

Key Components:

  1. eventName: Identifies the specific event type as "AssessmentResponseToWellbeingScore".

  2. patientId: A unique identifier for the patient whose wellbeing score is being calculated or updated.

  3. eventEntity: Specifies the type of entity involved, in this case, "Survey_Response".

  4. assessmentResponseId: A unique identifier for the specific assessment response being processed.

5. BookAppointment

Triggers when a new appointment is booked.

Sample Headers:

Sample payload:

Key Components:

  1. Appointment Details: Includes id, date, startTime, endTime, locationType, and status.

  2. Patient Information: Contains patientId, firstName, lastName, email, and patientMobileNumber.

  3. Appointment Type: Provides details about the type of appointment, including name, description, and durationInMinutes.

  4. Participants: Lists the healthcare providers involved in the appointment.

  5. Attributes: Contains additional appointment details such as patient location, chief complaint, and workflow information.

  6. Resources: Includes any additional resources booked for the appointment, such as follow-up consultations or tests.

6. InferenceToCareTasks

Generates care tasks based on inferred medical data.

Sample Header:

Sample Payload:

Key Components:

  1. inputData: Contains information about files, survey responses, and observation codes.

  2. event: Specifies the event type (InferenceToCareTasks).

  3. useCaseName: Indicates the use case (File Ingestion).

  4. data: Includes patient-specific information, goals, and key findings.

  5. model: Specifies the AI model to be used for inference.

  6. prompts: Contains the prompts for generating recommendations.

7. HealthRecordCounter

Provides a count of health records for a patient.

Sample payload:

Key Components:

  1. count: An integer representing the number of health records for the patient.

  2. eventName: The name of the event, set to "HealthRecordCounter".

  3. patientId: A unique identifier for the patient whose health records are being counted.

8. Notification

Sends various types of notifications.

Sample payload:

Key Components:

  1. data.appointment: Contains comprehensive details about the telehealth appointment, including:

    • Basic appointment information (id, date, time, status)

    • Patient details (name, email, phone, etc.)

    • Appointment attributes (status, patient time, chief complaint)

    • Telehealth-specific information (openTeleRoom)

    • Provider information (participants)

    • Appointment type details

  2. data.patientName: The full name of the patient who joined the waiting room.

  3. Event metadata: Specifies the nature and context of the event (Notification for a patient joining the virtual waiting room).

9. HealthProgramActivated

Triggers when a patient is enrolled in a health program.

Sample payload:

Key Components:

  1. data.duration: The duration of the health program (in a specified unit, e.g., days or weeks).

  2. data.patientId: A unique identifier for the patient.

  3. data.providers: An array of healthcare providers associated with the program, including their roles and contact information.

  4. data.patientName: The name of the patient for whom the health program is activated.

10. UploadedFileAndTest

Notifies when a file is uploaded and associated tests are completed.

Sample Header:

Sample payload:

Key Components:

  1. data.patient: Contains essential patient information including demographics and health scores.

  2. data.file: Provides details about the uploaded file, including:

    • File metadata (id, name, cloudId, etc.)

    • Client details extracted from the file

    • Archival status

  3. data.providers: An array of healthcare providers associated with the organization, including their roles and contact information.

  4. Event metadata: Specifies the nature and context of the event.

11. SurveyAssessment

This event is triggered when a health assessment survey is completed, providing comprehensive patient data and assessment results.

Sample Header:

Sample payload:

Key Components:

  1. data.patient: Contains comprehensive patient information, including personal details, contact information, and health scores.

  2. data.assessment: Includes details about the completed health assessment:

    • Basic assessment information (ID, name, status, etc.)

    • assessmentQuestionnaireObject: Structure of the questionnaire

    • assessmentResponseObject: Patient's responses to the questionnaire

    • assignedServiceProviders: Healthcare providers assigned to the patient

  3. Event Metadata:

    • eventName: "SurveyAssessment"

    • eventType: "SURVEY"

    • eventSubType: "ASSESSMENT_COMPLETED"

    • userType: "serviceProvider"

12. OpenTele

Triggers for telemedicine-related events.

Sample payload:

Receiving Webhooks

Once your webhook configurations are set up, you will start receiving webhook payloads at the specified URL for the events you've subscribed to. Ensure your endpoint is capable of handling POST requests and processing the JSON payloads.

For security, validate the incoming webhooks using the secret provided in your webhook configuration.

Best Practices

  1. Implement retry logic in case of temporary failures.

  2. Process webhooks asynchronously to avoid blocking responses.

  3. Verify the webhook signature using the provided secret.

  4. Implement proper error handling and logging.

  5. Consider setting up a test environment to simulate webhook events.

For any technical questions or issues with webhook integration, please contact our integration support team at [email protected].

Last updated