asyncapi: 2.0.0
info:
  version: 3.0.1
  x-visibility: external
  title: Event Management Events Notification Async API  
  description: |
    Notification for Event Management Events Async API provides messaging operations for receiving notifications when the event is created or updated.

    User will receive notifications about the Events after subscribing to the given topic. The notication message will contain information like id of the event, assetId and timestamp. The tenant and topicId will be provided as part of header for the message. Sample message payload can be found in the examples section below.
    
    **Limitations:**
    * The user can expect maximum of 1000 events information in one notification message.
    
    Please see the 'Event Management Events Notification Async API' section in the MindSphere Developer Documentation page to get more details.
    
defaultContentType: application/json

channels:
  mdsp.core.eventmanagement.v1.pubsub.eventnotification:
    description: The topic ID on which Event Management events notification will be received.
    subscribe:
      summary: Subscribe to this topic to receive Event Management events notification message.
      message:
        $ref: '#/components/messages/notificationData'

components:
  messages:
    notificationData:
      title: Event Management events notification
      summary: Notify about the event created or updated.
      contentType: application/json
      payload:
        $ref: "#/components/schemas/notificationPayload"

  schemas:
    notificationPayload:
      type: object
      properties:
        header:
          type: object
          description: The message payload will be grouped based upon the tenant.
          properties:
            topic:
              type: string
              description: Topic name to which the tenant is subscribed
              example: mdsp.core.eventmanagement.v1.pubsub.eventnotification
            tenantContext:
              type: array
              minimum: 1
              description: Tenant Context of tenant
              items:
                  type: string
                  example: siemens
        events:
          type: array
          minimum: 1
          description: Array of event related information (maximum 1000 per notification message).
          items:
              type: object
              properties:
                id:
                  type: string
                  description: Unique identifier for the event i.e. eventId
                  example: baeb542e-0730-46a9-88c9-d0982631645c
                assetId:
                  type: string
                  description: Id of the asset to which event is associated
                  example: 01096640c2164e84aa0442114147ea6e
                timestamp:
                  type: string
                  description: Timestamp associated with event during its creation
                  example: 2021-07-12T03:55:00Z
        