openapi: 3.0.0
info:
  title: Aura Bridge
  description: Set of endpoints that support the aura bridge
  version: 1.1.0
tags:
  - name: bridge
    description: General aura bridge API operations
  - name: directline
    description: Bot Operations
  - name: 4p
    description: Communication with 4p
  - name: whatsapp
    description: Whatsapp's Specific Bridge Operations
  - name: auraPush
    description: AuraPush's Specific Bridge Operations
  - name: admin
    description: Bridge administration plugin
  - name: genesys
    description: Communication with Genesys
  - name: async-callback
    description: Accept asynchronous notifications
servers:
  - url: 'http://localhost:8045'
    description: Local server
  - url: 'https://svc-ap-current.auracognitive.com'
    description: ap-current
paths:
  /healthz:
    get:
      tags:
        - bridge
      description: API Bridge Health Check.
      operationId: healthz
      x-router-controller: genericPath
      responses:
        '200':
          description: OK
          headers: {}
  /favicon.ico:
    get:
      tags:
        - bridge
      description: Get favicon.
      operationId: favicon
      x-router-controller: genericPath
      responses:
        '204':
          description: favicon
          headers: {}
  /shutdown:
    get:
      tags:
        - bridge
      description: API Bridge Shutdown Graceful.
      operationId: shutdown
      x-router-controller: genericPath
      responses:
        '200':
          description: OK
          headers: {}
  /metrics:
    get:
      tags:
        - bridge
      description: Metrics of bridge.
      operationId: metrics
      x-router-controller: metrics
      responses:
        '200':
          description: metrics
          content:
            string:
              schema:
                $ref: '#/components/schemas/MetricsMessage'
  '/aura-services/{channelName}/v3/conversations/{conversationId}/activities':
    post:
      tags:
        - directline
      description: >-
        Send a message from the bot to a specific channel The channel will be determined by the channelName that will be in charge of
        transforming the message for the channel to understand.
      operationId: postDirectlineConversationsActivities
      x-router-controller: plugins
      parameters:
        - name: channelName
          in: path
          description: Channel name
          required: true
          schema:
            type: string
        - name: conversationId
          in: path
          description: Conversation Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Activity'
      responses:
        '200':
          description: The operation succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
        '204':
          description: The operation succeeded. No content was returned.
        '400':
          description: 'The URL, body, or headers in the request are malformed or invalid.'
        '401':
          description: The operation included an invalid or missing Authorization header.
        '403':
          description: You are forbidden from performing this action because your token or secret is invalid.
        '404':
          description: The requested resource was not found.
        '429':
          description: >-
            Too many requests have been submitted to this API. This error may be accompanied by a Retry-After header, which includes the
            suggested retry interval.
        '500':
          description: An internal server error has occurred.
        '502':
          description: The bot is unavailable or returned an error.
  '/aura-services/{channelName}/v3/conversations/{conversationId}/activities/{messageId}':
    post:
      tags:
        - directline
      description: >-
        Send a message from the bot to a specific channel The channel will be determined by the channelName that will be in charge of
        transforming the message for the channel to understand.
      operationId: postDirectlineConversationsActivities
      x-router-controller: plugins
      parameters:
        - name: channelName
          in: path
          description: Channel name
          required: true
          schema:
            type: string
        - name: conversationId
          in: path
          description: Conversation Id
          required: true
          schema:
            type: string
        - name: messageId
          in: path
          description: Message Id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Activity'
      responses:
        '200':
          description: The operation succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
        '204':
          description: The operation succeeded. No content was returned.
        '400':
          description: 'The URL, body, or headers in the request are malformed or invalid.'
        '401':
          description: The operation included an invalid or missing Authorization header.
        '403':
          description: You are forbidden from performing this action because your token or secret is invalid.
        '404':
          description: The requested resource was not found.
        '429':
          description: >-
            Too many requests have been submitted to this API. This error may be accompanied by a Retry-After header, which includes the
            suggested retry interval.
        '500':
          description: An internal server error has occurred.
        '502':
          description: The bot is unavailable or returned an error.
  /aura-services/v1/whatsapp/messages:
    post:
      security:
        - ApiKeyAuth: []
      parameters:
        - name: x-correlator
          in: header
          description: correlator to identify the request
          required: false
          schema:
            type: string
        - name: answers-callback
          in: header
          description: Answers callback for testing
          schema:
            type: string
        - name: genesys-callback
          in: header
          description: Genesys platform url (real or mock)
          schema:
            type: string
        - name: channelId
          in: query
          description: channel identifier of request
          required: false
          schema:
            type: string
      tags:
        - whatsapp
      description: Receiving a WhatsApp Business API message. No delivered callback endpoint needed because it is the bridge itself.
      operationId: postWhatsappMessages
      x-router-controller: plugins
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsAppBusinessAPIMessage'
      responses:
        '200':
          description: Accepted
        '400':
          description: 'The URL, body, or headers in the request are malformed or invalid.'
        '401':
          description: The operation included an invalid or missing Authorization header.
  /aura-services/v1/aurapush/messages:
    post:
      security:
        - ApiKeyAuth: []
        - ApiKeyHeaderAuth: []
      parameters:
        - name: x-correlator
          in: header
          description: correlator to identify the request
          required: false
          schema:
            type: string
        - name: channelId
          in: query
          description: channel identifier of request
          required: false
          schema:
            type: string
      tags:
        - auraPush
      description: Receiving a AuraPush API message.
      operationId: postAuraPushMessages
      x-router-controller: plugins
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuraPushMessage'
      responses:
        '200':
          description: Accepted
        '400':
          description: 'The URL, body, or headers in the request are malformed or invalid.'
        '401':
          description: The operation included an invalid or missing Authorization header.
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: 'Could not send message, the contact is invalid'
  /heapSnapshot:
    get:
      tags:
        - bridge
      description: Store a snapshot in azure storage.
      operationId: heapSnapshot
      x-router-controller: plugins
      responses:
        '200':
          description: OK
          headers: {}
        '500':
          description: An internal server error has occurred.
  /heapStatistics:
    get:
      tags:
        - bridge
      description: Get heap Statistics.
      operationId: heapStatistics
      x-router-controller: plugins
      responses:
        '200':
          description: OK
          headers: {}
        '500':
          description: An internal server error has occurred.
  /aura-services/v1/genesys/messages:
    post:
      security:
        - ApiKeyAuth: []
      tags:
        - genesys
      description: Receive the messages issued by the Agents to be sent to the bot.
      operationId: postGenesysMessages
      x-router-controller: plugins
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenesysPushNotification'
      responses:
        '200':
          description: The operation succeeded.
  /aura-services/v1/async-callback/notifications:
    post:
      security:
        - ApiKeyAuth: []
        - ApiKeyHeaderAuth: []
      parameters:
        - name: x-correlator
          in: header
          description: correlator to identify the request
          required: false
          schema:
            type: string
        - name: answers-callback
          in: query
          description: Answers callback for testing
          required: false
          schema:
            type: string
        - name: data
          in: query
          description: Encrypted parameters of request.
          required: true
          schema:
            type: string
            example: '{ auraId: xx, conversationId: xxx, channelId: xxx, calbackId: xx, responseVersion: xx, responseVChannel: xx }'
        - name: messageId
          in: query
          description: Original request identifier.
          required: false
          schema:
            type: string
      tags:
        - async-callback
      description: Receiving a asynchronous notification message.
      operationId: postAsyncCallbackNotifications
      x-router-controller: plugins
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AsyncCallbackNotification'
      responses:
        '200':
          description: Accepted
        '400':
          description: 'The URL, body, or headers in the request are malformed or invalid.'
          $ref: '#/components/responses/RequestMalformed'
        '401':
          description: The operation included an invalid or missing Authorization header.
          $ref: '#/components/responses/Unauthorized'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: apikey
    ApiKeyHeaderAuth:
      type: apiKey
      in: header
      name: Authorization
  responses:
    RequestMalformed:
      description: 'The URL, body, or headers in the request are malformed or invalid'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuraError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuraError'
  schemas:
    MetricsMessage:
      type: object
    FaviconResponse:
      type: object
    ResourceResponse:
      description: A response containing a resource ID
      type: object
      properties:
        id:
          description: Id of the resource
          type: string
    ChannelAccount:
      description: Channel account information needed to route a message
      type: object
      properties:
        id:
          description: 'Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or 123456)'
          type: string
        name:
          description: Display friendly name
          type: string
        aadObjectId:
          description: This account's object ID within Azure Active Directory (AAD)
          type: string
        role:
          description: 'Role of the entity behind the account (Example: User, Bot, etc.)'
          type: string
    ConversationAccount:
      description: Conversation account represents the identity of the conversation within a channel
      type: object
      properties:
        isGroup:
          description: Indicates whether the conversation contains more than two participants at the time the activity was generated
          type: boolean
        conversationType:
          description: Indicates the type of the conversation in channels that distinguish between conversation types
          type: string
        tenantId:
          description: This conversation's tenant ID
          type: string
        id:
          description: 'Channel id for the user or bot on this channel (Example: joe@smith.com, or @joesmith or 123456)'
          type: string
        name:
          description: Display friendly name
          type: string
        aadObjectId:
          description: This account's object ID within Azure Active Directory (AAD)
          type: string
        role:
          description: 'Role of the entity behind the account (Example: User, Bot, etc.)'
          type: string
    MessageReaction:
      description: Message reaction object
      type: object
      properties:
        type:
          description: Message reaction type
          type: string
    CardAction:
      description: A clickable action
      type: object
      properties:
        type:
          description: The type of action implemented by this button
          type: string
        title:
          description: Text description which appears on the button
          type: string
        image:
          description: 'Image URL which will appear on the button, next to text label'
          type: string
        text:
          description: Text for this action
          type: string
        displayText:
          description: (Optional) text to display in the chat feed if the button is clicked
          type: string
        value:
          description: Supplementary parameter for action. Content of this property depends on the ActionType
          type: object
        channelData:
          type: object
          description: Channel-specific data associated with this action
    SuggestedActions:
      description: SuggestedActions that can be performed
      type: object
      properties:
        to:
          description: >-
            Ids of the recipients that the actions should be shown to.  These Ids are relative to the channelId and a subset of all
            recipients of the activity
          type: array
          items:
            type: string
        actions:
          description: Actions that can be shown to the user
          type: array
          items:
            $ref: '#/components/schemas/CardAction'
    Attachment:
      description: An attachment within an activity
      type: object
      properties:
        contentType:
          description: mimetype/Contenttype for the file
          type: string
        contentUrl:
          description: (OPTIONAL) Content Url
          type: string
        content:
          description: (OPTIONAL) Embedded content
        name:
          description: (OPTIONAL) The name of the attachment
          type: string
        thumbnailUrl:
          description: (OPTIONAL) Thumbnail associated with attachment
          type: string
    Entity:
      description: Metadata object pertaining to an activity
      type: object
      properties:
        type:
          description: Type of this entity (RFC 3987 IRI)
          type: string
    ConversationReference:
      description: An object relating to a particular point in a conversation
      type: object
      properties:
        activityId:
          description: (Optional) ID of the activity to refer to
          type: string
        user:
          $ref: '#/components/schemas/ChannelAccount'
        bot:
          $ref: '#/components/schemas/ChannelAccount'
        conversation:
          $ref: '#/components/schemas/ConversationAccount'
        channelId:
          description: Channel ID
          type: string
        serviceUrl:
          description: Service endpoint where operations concerning the referenced conversation may be performed
          type: string
    TextHighlight:
      description: Refers to a substring of content within another field
      type: object
      properties:
        text:
          description: Defines the snippet of text to highlight
          type: string
        occurrence:
          format: int32
          description: 'Occurrence of the text field within the referenced text, if multiple exist.'
          type: integer
    SemanticAction:
      description: Represents a reference to a programmatic action
      type: object
      properties:
        state:
          description: 'State of this action. Allowed values: `start`, `continue`, `done`'
          type: string
        id:
          description: ID of this action
          type: string
        entities:
          description: Entities associated with this action
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Entity'
    Activity:
      description: An Activity is the basic communication type for the Bot Framework 3.0 protocol.
      type: object
      required:
        - recipient
      properties:
        type:
          description: Contains the activity type.
          type: string
        id:
          description: Contains an ID that uniquely identifies the activity on the channel.
          type: string
        timestamp:
          format: date-time
          description: 'Contains the date and time that the message was sent, in UTC, expressed in ISO-8601 format.'
          type: string
        localTimestamp:
          format: date-time
          description: "Contains the local date and time of the message, expressed in ISO-8601 format.\r\nFor example, 2016-09-23T13:07:49.4714686-07:00."
          type: string
        localTimezone:
          description: "Contains the name of the local timezone of the message, expressed in IANA Time Zone database format.\r\nFor example, America/Los_Angeles."
          type: string
        serviceUrl:
          description: Contains the URL that specifies the channel's service endpoint. Set by the channel.
          type: string
        channelId:
          description: Contains an ID that uniquely identifies the channel. Set by the channel.
          type: string
        from:
          $ref: '#/components/schemas/ChannelAccount'
        conversation:
          $ref: '#/components/schemas/ConversationAccount'
        recipient:
          $ref: '#/components/schemas/ChannelAccount'
        textFormat:
          description: 'Format of text fields Default:markdown'
          type: string
        attachmentLayout:
          description: 'The layout hint for multiple attachments. Default: list.'
          type: string
        membersAdded:
          description: The collection of members added to the conversation.
          type: array
          items:
            $ref: '#/components/schemas/ChannelAccount'
        membersRemoved:
          description: The collection of members removed from the conversation.
          type: array
          items:
            $ref: '#/components/schemas/ChannelAccount'
        reactionsAdded:
          description: The collection of reactions added to the conversation.
          type: array
          items:
            $ref: '#/components/schemas/MessageReaction'
        reactionsRemoved:
          description: The collection of reactions removed from the conversation.
          type: array
          items:
            $ref: '#/components/schemas/MessageReaction'
        topicName:
          description: The updated topic name of the conversation.
          type: string
        historyDisclosed:
          description: Indicates whether the prior history of the channel is disclosed.
          type: boolean
        locale:
          description: "A locale name for the contents of the text field.\r\nThe locale name is a combination of an ISO 639 two- or three-letter culture code associated with a language\r\nand an ISO 3166 two-letter subculture code associated with a country or region.\r\nThe locale name can also correspond to a valid BCP-47 language tag."
          type: string
        text:
          description: The text content of the message.
          type: string
        speak:
          description: The text to speak.
          type: string
        inputHint:
          description: "Indicates whether your bot is accepting,\r\nexpecting, or ignoring user input after the message is delivered to the client."
          type: string
        summary:
          description: The text to display if the channel cannot render cards.
          type: string
        suggestedActions:
          $ref: '#/components/schemas/SuggestedActions'
        attachments:
          description: Attachments
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        entities:
          description: Represents the entities that were mentioned in the message.
          type: array
          items:
            $ref: '#/components/schemas/Entity'
        channelData:
          $ref: '#/components/schemas/ChannelData'
        action:
          description: Indicates whether the recipient of a contactRelationUpdate was added or removed from the sender's contact list.
          type: string
        replyToId:
          description: Contains the ID of the message to which this message is a reply.
          type: string
        label:
          description: A descriptive label for the activity.
          type: string
        valueType:
          description: The type of the activity's value object.
          type: string
        value:
          description: A value that is associated with the activity.
          type: object
        name:
          description: The name of the operation associated with an invoke or event activity.
          type: string
        relatesTo:
          $ref: '#/components/schemas/ConversationReference'
        code:
          description: The a code for endOfConversation activities that indicates why the conversation ended.
          type: string
        expiration:
          format: date-time
          description: The time at which the activity should be considered to be "expired" and should not be presented to the recipient.
          type: string
        importance:
          description: The importance of the activity.
          type: string
        deliveryMode:
          description: "A delivery hint to signal to the recipient alternate delivery paths for the activity.\r\nThe default delivery mode is \"default\"."
          type: string
        listenFor:
          description: List of phrases and references that speech and language priming systems should listen for
          type: array
          items:
            type: string
        textHighlights:
          description: The collection of text fragments to highlight when the activity contains a ReplyToId value.
          type: array
          items:
            $ref: '#/components/schemas/TextHighlight'
        semanticAction:
          $ref: '#/components/schemas/SemanticAction'
    Suggestion:
      type: object
      properties:
        intent:
          type: string
        entities:
          type: array
          items:
            $ref: '#/components/schemas/EntityModel'
    Notification:
      type: object
      properties:
        action:
          type: string
          description: >-
            This property includes the Aura intention reference informing of the dialog to be executed to accomplish the Telefónica client
            intent.
        notificationData:
          type: object
          description: >-
            This property includes detailed information about the notification being sent to the Telefónica client. The data sent will let
            Aura predict unusual behaviour in clients billing, balance or data consumption.
    EntityModel:
      type: object
      properties:
        canon:
          type: string
          description: >-
            This property includes the canonical form of the entity sent on behalf of the Telefónica client interacting with the Aura bot
            instance.
        endIndex:
          type: integer
          description: The index at which this entity ends in the original user message.
        entity:
          type: string
          description: This property includes the value of the entity sent on behalf of the Telefónica client interacting with the Aura bot instance.
        label:
          type: string
          description: >-
            This property includes an internally used descriptive tag of the entity sent on behalf of the Telefónica client interacting with
            the Aura bot instance.
        score:
          type: number
          description: >-
            This property includes the accuracy (in per 1 units) of the recognized entity sent on behalf of the Telefónica client
            interacting with the Aura bot instance. In the case of Aura commands this value should be 1 since in this case fully recognized
            intentions are sent.
        startIndex:
          type: string
          description: The index at which this entity starts in the original user message.
        type:
          type: string
          description: This property includes the type of the entity sent on behalf of the Telefónica client interacting with the Aura bot instance.
    dialogContextItem:
      type: object
      description: This property will be sent by the corresponding dialog in any case an extra intention recognition is needed.
      properties:
        text:
          type: string
          description: This property includes the word to be recognized.
        value:
          type: object
          properties:
            intent:
              type: string
              description: This property includes the Aura intention reference which will determine the Aura dialog to execute.
            entities:
              type: array
              description: >-
                This property includes an array of additional information the Aura bot instance needs to properly accomplish the intent of
                the Telefónica client.
              items:
                $ref: '#/components/schemas/EntityModel'
    AuraCommand:
      type: object
      properties:
        type:
          type: string
          description: This property includes the type of Aura command sent on behalf of the Telefónica client interacting with the Aura bot instance.
          enum:
            - intent
            - suggestion
            - notification
            - operation
            - text
            - event
        value:
          type: object
          oneOf:
            - $ref: '#/components/schemas/Suggestion'
            - $ref: '#/components/schemas/Notification'
        utm:
          type: object
          description: It shows the exact interface element that was used by the user to launch the auraCommand
          properties:
            source:
              type: string
              description: 'Identifies which site sent the traffic. Please, use the channel name.'
            medium:
              type: string
              description: 'Identifies what type of link was used, such as cost per click or email. In Aura use banner, button, etc.'
            campaign:
              type: string
              description: Identifies a specific product promotion or strategic campaign.
            term:
              type: string
              description: Identifies search terms. We still need to define the content of this field.
            content:
              type: string
              description: 'Identifies what specifically was clicked to bring the user to the site, such as a banner ad or a text link.'
        actions:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Action to be performed
              target:
                type: string
                description: >-
                  Target for the action, such as stb . If the action should be executed by the device used by the user to interact with
                  Aura, the value should be channel . The STB team should consider the value stb and channel indistinctly (in the same way)
              params:
                type: object
                description: An object with the required params for the action.
    ChannelData:
      type: object
      properties:
        intentResult:
          type: object
          properties:
            id:
              type: string
              description: >-
                Intent identifier, such as intent.tv.launch. This property should not be used to apply any logic in the channel. To do that
                it should be used the property name.
            name:
              type: string
              description: 'Intent name (the intent recognized, processed and resolved by Aura), such as STB_ACTION.PLAY_ON_TV or MEDIA.SEARCH.'
            entities:
              type: array
              description: Array of entities detected by Aura (it may be empty)
              items:
                $ref: '#/components/schemas/EntityModel'
        actions:
          type: array
          description: >-
            Array of Actions, the actions available for this Aura response It contains both general sub-properties and specific ones
          items:
            type: object
            properties:
              name:
                type: string
                description: Action to be performed
              target:
                type: string
                description: >-
                  Target for the action, such as stb. If the action should be executed by the device used by the user to interact with Aura,
                  the value should be channel . The STB team should consider the value stb and channel indistinctly (in the same way)
              params:
                type: object
                description: An object with the required params for the action.
              postBack:
                type: object
                description: >-
                  Specifies the action to be performed by the channel once the action is completed. Depending on the result, independent
                  actions could be executed.
                properties:
                  ok:
                    $ref: '#/components/schemas/AuraCommand'
                  error:
                    $ref: '#/components/schemas/AuraCommand'
        dialogContext:
          type: array
          description: >-
            This property includes an array of additional information the Aura bot instance needs to properly accomplish the intent of the
            Telefónica client.
          items:
            $ref: '#/components/schemas/dialogContextItem'
        status:
          type: object
          description: Object describing the status of the request sent to the Aura bot instance.
          properties:
            code:
              type: string
              description: Internal Aura status code. We will include a link to a document with the codes in a next release of this document.
            message:
              type: string
              description: Descriptive text with additional information
            params:
              type: object
              description: >-
                Extended information about the status, it may be empty or not sent. If exists, it will contain extra params needed to handle
                programmatically the status properly.
        version:
          type: string
          description: >-
            This property encodes the version of the Aura Request-Response Semantic Model being used so the structural dependencies and
            semantics of the data provided can be properly managed
        correlator:
          type: string
          description: >-
            This property contains an UUID uniquely identifying the concrete request sent through the channel. This unique identifier is of
            great help when doing cross system analysis, as a way to correlate the actions executed by distinct elements of the whole system
            associated to the fulfilment of the same request
    WhatsAppBusinessAPIMessage:
      oneOf:
        - $ref: '#/components/schemas/Messages'
        - $ref: '#/components/schemas/Statuses'
        - $ref: '#/components/schemas/Errors'
        - $ref: '#/components/schemas/Contacts'
    Messages:
      type: object
      required:
        - messages
      properties:
        contacts:
          type: array
          items:
            type: object
            properties:
              profile:
                type: object
                properties:
                  name:
                    type: string
              wa_id:
                type: string
        messages:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/Text'
              - $ref: '#/components/schemas/Image'
              - $ref: '#/components/schemas/Video'
              - $ref: '#/components/schemas/Document'
              - $ref: '#/components/schemas/Audio'
              - $ref: '#/components/schemas/Sticker'
              - $ref: '#/components/schemas/Voice'
              - $ref: '#/components/schemas/Location'
              - $ref: '#/components/schemas/Contact'
              - $ref: '#/components/schemas/Unknown'
              - $ref: '#/components/schemas/System'
              - $ref: '#/components/schemas/Button'
              - $ref: '#/components/schemas/Interactive'
            discriminator:
              propertyName: type
          minItems: 1
    BasicWhatsappMessageModel:
      type: object
      required:
        - id
        - from
        - timestamp
      properties:
        context:
          type: object
          properties:
            from:
              type: string
              description: WhatsApp ID of the sender of the original message
            id:
              type: string
              description: Message ID of original message
            mentions:
              type: array
              items:
                type: string
            forwarded:
              type: boolean
            frequently_forwarded:
              type: boolean
        id:
          type: string
        identity:
          type: object
          properties:
            acknowledged:
              type: string
              description: State of acknowledgment for latest user_identity_changed system notification
            created_timestamp:
              type: integer
              description: Timestamp of when the WhatsApp Business API client detected the user potentially changed
            hash:
              type: string
              description: Identifier for the latest user_identity_changed system notification
        from:
          type: string
        referral:
          type: object
          properties:
            headline:
              type: string
              description: Headline used in the ad that generated the message
            body:
              type: string
              description: Body from the ad that generated the message
            source_type:
              type: string
              description: 'The type of the ad source. Currently, supported values are ad and post'
            source_id:
              type: string
              description: Facebook ID for an ad or a post
            source_url:
              type: string
              description: The url that leads to the ad. Opening this url takes you to the ad viewed by your user
        timestamp:
          type: string
    Text:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - text
          properties:
            type:
              type: string
              enum:
                - text
            text:
              type: object
              required:
                - body
              properties:
                body:
                  type: string
    Image:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - image
          properties:
            type:
              type: string
              enum:
                - image
            image:
              type: object
              required:
                - id
                - mime_type
              properties:
                id:
                  type: string
                mime_type:
                  type: string
                sha256:
                  type: string
                caption:
                  type: string
    Video:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - video
          properties:
            type:
              type: string
              enum:
                - video
            video:
              type: object
              required:
                - id
                - mime_type
              properties:
                id:
                  type: string
                file:
                  type: string
                mime_type:
                  type: string
                sha256:
                  type: string
                caption:
                  type: string
    Document:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - document
          properties:
            type:
              type: string
              enum:
                - document
            document:
              type: object
              required:
                - id
                - mime_type
              properties:
                filename:
                  type: string
                id:
                  type: string
                mime_type:
                  type: string
                sha256:
                  type: string
                caption:
                  type: string
    Audio:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - audio
          properties:
            type:
              type: string
              enum:
                - audio
            audio:
              type: object
              required:
                - id
                - mime_type
              properties:
                id:
                  type: string
                caption:
                  type: string
                file:
                  type: string
                mime_type:
                  type: string
                sha256:
                  type: string
    Sticker:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - sticker
          properties:
            type:
              type: string
              enum:
                - sticker
            sticker:
              type: object
              required:
                - id
                - mime_type
              properties:
                id:
                  type: string
                mime_type:
                  type: string
                sha256:
                  type: string
                caption:
                  type: string
                metadata:
                  type: object
    Voice:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - voice
          properties:
            type:
              type: string
              enum:
                - voice
            voice:
              type: object
              required:
                - id
                - mime_type
              properties:
                id:
                  type: string
                mime_type:
                  type: string
                sha256:
                  type: string
                caption:
                  type: string
    Location:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - location
          properties:
            type:
              type: string
              enum:
                - location
            location:
              type: object
              required:
                - address
                - latitude
                - longitude
                - name
                - url
              properties:
                address:
                  type: string
                latitude:
                  type: number
                longitude:
                  type: number
                name:
                  type: string
                url:
                  type: string
    Contact:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - contacts
          properties:
            type:
              type: string
              enum:
                - contacts
            contacts:
              type: array
              items:
                type: object
                properties:
                  addresses:
                    type: array
                    items:
                      type: object
                      properties:
                        city:
                          type: string
                        country:
                          type: string
                        country_code:
                          type: string
                        state:
                          type: string
                        street:
                          type: string
                        type:
                          type: string
                        zip:
                          type: string
                  birthday:
                    type: string
                  contact_image:
                    type: string
                  emails:
                    type: array
                    items:
                      type: object
                      properties:
                        email:
                          type: string
                        type:
                          type: string
                  ims:
                    type: array
                    items:
                      type: object
                      properties:
                        service:
                          type: string
                        user_id:
                          type: string
                  name:
                    type: object
                    properties:
                      first_name:
                        type: string
                      middle_name:
                        type: string
                      last_name:
                        type: string
                      formatted_name:
                        type: string
                      name_prefix:
                        type: string
                      name_suffix:
                        type: string
                  org:
                    type: object
                    properties:
                      company:
                        type: string
                  phones:
                    type: array
                    items:
                      type: object
                      properties:
                        phone:
                          type: string
                        type:
                          type: string
                        wa_id:
                          type: string
                  urls:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                        type:
                          type: string
    Unknown:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - errors
          properties:
            type:
              type: string
              enum:
                - unknown
            errors:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: number
                  title:
                    type: string
                  details:
                    type: string
    System:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - system
          properties:
            type:
              type: string
              enum:
                - system
            system:
              type: object
              required:
                - body
              properties:
                body:
                  type: string
                identity:
                  type: string
                type:
                  type: string
                user:
                  type: string
    Button:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - button
          properties:
            type:
              type: string
              enum:
                - button
            system:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
                payload:
                  type: string
    Interactive:
      allOf:
        - $ref: '#/components/schemas/BasicWhatsappMessageModel'
        - type: object
          required:
            - type
            - interactive
          properties:
            type:
              type: string
              enum:
                - interactive
            interactive:
              type: object
              properties:
                type:
                  type: string
                list_reply:
                  type: object
                  required:
                    - id
                    - title
                  properties:
                    id:
                      type: string
                    title:
                      type: string
                    description:
                      type: string
                button_reply:
                  type: object
                  required:
                    - id
                    - title
                  properties:
                    id:
                      type: string
                    title:
                      type: string
    Statuses:
      type: object
      required:
        - statuses
      properties:
        statuses:
          type: array
          items:
            type: object
            required:
              - id
              - recipient_id
              - timestamp
              - status
            properties:
              id:
                type: string
              recipient_id:
                type: string
              timestamp:
                type: string
              status:
                type: string
                enum:
                  - read
                  - sent
                  - delivered
                  - failed
                  - deleted
              errors:
                type: array
                items:
                  type: object
                  properties:
                    code:
                      type: number
                    title:
                      type: string
                    href:
                      type: string
          minItems: 1
    Errors:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - code
              - title
              - details
            properties:
              code:
                type: number
              title:
                type: string
              details:
                type: string
              href:
                type: string
          minItems: 1
    Contacts:
      type: object
      required:
        - contacts
      properties:
        contacts:
          type: array
          items:
            type: object
            required:
              - input
              - status
            properties:
              input:
                type: string
              status:
                type: string
                enum:
                  - processing
                  - valid
                  - invalid
                  - failed
              wa_id:
                type: string
          minItems: 1
    AuraPushMessage:
      description: Aura push message
      title: AuraPushMessage
      type: object
      properties:
        id:
          description: Unique message identifier
          type: string
          title: id
        from:
          description: User sending the message
          type: string
          title: from
        text:
          description: Message text
          type: string
          title: text
        type:
          $ref: '#/components/schemas/AuraPushMessageType'
          description: Message type
          title: type
        notificationData:
          description: Notification data
          title: notificationData
          type: object
        template:
          $ref: '#/components/schemas/AuraPushMessageTemplateType'
          description: Notification template
          title: template
        checkContacts:
          type: boolean
          description: flag to perform the check
          title: checkContact
      required:
        - from
        - id
        - text
        - type
    AuraPushMessageTemplateType:
      properties:
        name:
          type: string
          description: name
          title: name
        namespace:
          type: string
          description: namespace
          title: namespace
        parameters:
          type: object
          description: parameters
          title: parameters
      description: Types of template sent from aura push
      title: AuraPushMessageTemplateType
      type: object
    AuraPushMessageType:
      enum:
        - directline
        - whatsapp
      description: Types of messages sent from aura push
      title: AuraPushMessageType
      type: string
    AuraError:
      type: object
      description: Error response
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: Error code
        message:
          type: string
          description: Specific and descriptive text of the error
    PartyResourceType:
      type: string
      enum:
        - Client
        - Agent
        - External
        - System
        - Supervisor
    EventType:
      type: string
      enum:
        - ParticipantJoined
        - ParticipantLeft
        - Message
        - TypingStarted
        - TypingStopped
        - NicknameUpdated
        - PushUrl
        - FileUploaded
        - FileDeleted
        - CustomNotice
        - Notice
        - IdleAlert
        - IdleClose
    QuitReasonCode:
      type: string
      enum:
        - '0'
        - '3'
        - '4'
        - '5'
        - '7'
        - '8'
      description: |
        When customer leaves a chat session (https://docs.genesys.com/Documentation/ESChat/8.5.3/Admin/RC):
         * 0:LogoutByUser - The participant left the chat session by sending a logout request. This reason code is not delivered in response through GMS Chat API, it is only sent in GMS custom-http push notifications.
         * 3:UserInactivity - The participant was removed by the server due to chat protocol inactivity (as configured by flex-push-timeout and/or flex-disconnect-timeout options). This reason code is not delivered in response through GMS Chat API, it is only sent in GMS custom-http push notifications
         * 4:UserRemove - The participant was removed by another participant (for example, by the agent, supervisor, or bot).
         * 5:UserRemoveServer - The participant was removed by the server (possibly for system reasons).
         * 7:UserInactivityByServer - The participant was removed by the server due to chat session inactivity (both for regular and async modes).
         * 8:UserRemoveBySessionRestoration - The participant was marked as removed by the server during a chat session restoration (transcript normalization procedure) in HA mode.
    StatusCode:
      type: number
      enum:
        - 0
        - 1
        - 2
      description: |
        Genesys status code:
         * 0:Successful - Successful
         * 1:ErrorKeepTry - Indicates that there was an error and the client can keep trying until it receives a statusCode of 0
         * 2:Error - Error
    PartyResource:
      type: object
      required:
        - nickname
        - participantId
        - type
      properties:
        nickname:
          type: string
        participantId:
          type: number
        type:
          $ref: '#/components/schemas/PartyResourceType'
    ChatTranscript:
      type: object
      required:
        - from
        - index
        - type
        - utcTime
      properties:
        from:
          $ref: '#/components/schemas/PartyResource'
        index:
          type: number
        text:
          type: string
        type:
          $ref: '#/components/schemas/EventType'
        utcTime:
          type: number
        userData:
          description: 'Contains additional information for this event (map<string,string>).'
          type: object
          properties:
            auraConversationId:
              type: string
        eventAttributes:
          type: object
          properties:
            GCTI_SYSTEM:
              type: object
              properties:
                quit-reason-code:
                  $ref: '#/components/schemas/QuitReasonCode'
                party-info:
                  type: string
                  description: Agent and Supervisor user types can also be used by bots.
                pii-cleanup:
                  type: string
                  description: hat Server can be configured to detect and replace PII data in a chat session
    GenesysMessage:
      type: object
      required:
        - statusCode
      properties:
        statusCode:
          $ref: '#/components/schemas/StatusCode'
        alias:
          type: string
        chatEnded:
          type: boolean
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatTranscript'
        nextPosition:
          type: number
        secureKey:
          type: string
        userId:
          type: string
        monitored:
          type: boolean
    GenesysPushNotification:
      type: object
      required:
        - deviceId
        - message
      properties:
        deviceId:
          type: string
        message:
          $ref: '#/components/schemas/GenesysMessage'
    AsyncCallbackNotification:
      allOf:
        - type: object
          required:
            - payload
            - creation_date
            - user_id
          properties:
            payload:
              type: object
            creation_date:
              type: string
              format: date-time
              description: Notification creation date time
            user_id:
              type: string
              description: Unique identifier of the user in the 4P
