asyncapi: 3.0.0
info:
  title: HeroHealth Webhooks
  version: 1.0.0
servers:
  production:
    host: webhooks-manager.htech.app
    protocol: https
    description: Production
  staging:
    host: webhooks-manager.staging.htech.app
    protocol: https
    description: Staging
channels:
  appointment.confirmed:
    address: appointment.confirmed
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Appointment
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - appointment.confirmed
          required:
            - object
            - id
            - practice_group_id
            - event
  appointment.rescheduled:
    address: appointment.rescheduled
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Appointment
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - appointment.rescheduled
          required:
            - object
            - id
            - practice_group_id
            - event
  appointment.cancelled:
    address: appointment.cancelled
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Appointment
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - appointment.cancelled
          required:
            - object
            - id
            - practice_group_id
            - event
  prescription.issued:
    address: prescription.issued
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Prescription
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - prescription.issued
          required:
            - object
            - id
            - practice_group_id
            - event
  patient.medical-record-updated:
    address: patient.medical-record-updated
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Patient
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - patient.medical-record-updated
          required:
            - object
            - id
            - practice_group_id
            - event
  patient.added-to-sequence:
    address: patient.added-to-sequence
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Patient
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - patient.added-to-sequence
          required:
            - object
            - id
            - practice_group_id
            - event
  write-to-record.succeeded:
    address: write-to-record.succeeded
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - WriteToRecordEntry
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - write-to-record.succeeded
          required:
            - object
            - id
            - practice_group_id
            - event
  write-to-record.failed:
    address: write-to-record.failed
    messages:
      subscribe.message:
        contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - WriteToRecordEntry
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - write-to-record.failed
          required:
            - object
            - id
            - practice_group_id
            - event
operations:
  appointment.confirmed:
    action: send
    channel:
      address: appointment.confirmed
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Appointment
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - appointment.confirmed
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: An appointment has been confirmed
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Appointment
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - appointment.confirmed
          required:
            - object
            - id
            - practice_group_id
            - event
  appointment.rescheduled:
    action: send
    channel:
      address: appointment.rescheduled
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Appointment
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - appointment.rescheduled
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: An appointment has been rescheduled
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Appointment
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - appointment.rescheduled
          required:
            - object
            - id
            - practice_group_id
            - event
  appointment.cancelled:
    action: send
    channel:
      address: appointment.cancelled
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Appointment
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - appointment.cancelled
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: An appointment has been cancelled
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Appointment
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - appointment.cancelled
          required:
            - object
            - id
            - practice_group_id
            - event
  prescription.issued:
    action: send
    channel:
      address: prescription.issued
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Prescription
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - prescription.issued
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: A prescription has been issued
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Prescription
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - prescription.issued
          required:
            - object
            - id
            - practice_group_id
            - event
  patient.medical-record-updated:
    action: send
    channel:
      address: patient.medical-record-updated
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Patient
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - patient.medical-record-updated
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: A patient medical record has been updated
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Patient
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - patient.medical-record-updated
          required:
            - object
            - id
            - practice_group_id
            - event
  patient.added-to-sequence:
    action: send
    channel:
      address: patient.added-to-sequence
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - Patient
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - patient.added-to-sequence
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: A patient has been added to a sequence
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - Patient
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - patient.added-to-sequence
          required:
            - object
            - id
            - practice_group_id
            - event
  write-to-record.succeeded:
    action: send
    channel:
      address: write-to-record.succeeded
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - WriteToRecordEntry
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - write-to-record.succeeded
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: A WriteToRecord job finished successfully
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - WriteToRecordEntry
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - write-to-record.succeeded
          required:
            - object
            - id
            - practice_group_id
            - event
  write-to-record.failed:
    action: send
    channel:
      address: write-to-record.failed
      messages:
        subscribe.message:
          contentType: application/json
          payload:
            type: object
            properties:
              object:
                type: string
                enum:
                  - WriteToRecordEntry
              id:
                type: string
              practice_group_id:
                type: string
              event:
                type: string
                enum:
                  - write-to-record.failed
            required:
              - object
              - id
              - practice_group_id
              - event
    summary: A WriteToRecord job failed permanently
    messages:
      - contentType: application/json
        payload:
          type: object
          properties:
            object:
              type: string
              enum:
                - WriteToRecordEntry
            id:
              type: string
            practice_group_id:
              type: string
            event:
              type: string
              enum:
                - write-to-record.failed
          required:
            - object
            - id
            - practice_group_id
            - event
components: {}
