> Use the canonical URL for citations. For the complete Predict API documentation index, fetch https://docs.staging.trypredict.com/llms.txt.

# Notifications

GET /ws

Subscribe to Hyperliquid account notifications for a Predict master account or subaccount and route each server message by its notification payload.

Reference: https://docs.staging.trypredict.com/api-reference/web-socket-api/notifications

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: Notifications
  version: subpackage_notifications.notifications
  description: >-
    Subscribe to Hyperliquid account notifications for a Predict master account
    or subaccount and route each server message by its notification payload.
channels:
  /ws:
    description: >-
      Subscribe to Hyperliquid account notifications for a Predict master
      account or subaccount and route each server message by its notification
      payload.
    publish:
      operationId: subpackage_notifications.notifications-publish
      summary: Server message
      message:
        name: update
        payload:
          $ref: '#/components/schemas/notifications_NotificationMessage'
    subscribe:
      operationId: subpackage_notifications.notifications-subscribe
      summary: Client message
      message:
        name: subscribe
        payload:
          $ref: '#/components/schemas/notifications_SubscribeNotifications'
servers:
  Testnet:
    url: wss://api.hyperliquid-testnet.xyz/
    protocol: wss
    x-default: true
  Mainnet:
    url: wss://api.hyperliquid.xyz/
    protocol: wss
components:
  schemas:
    notifications_NotificationMessage:
      type: object
      properties:
        channel:
          type: string
          enum:
            - notification
        data:
          description: Any type
      required:
        - channel
        - data
      title: NotificationMessage
    common_SubscriptionMethod:
      type: string
      enum:
        - subscribe
        - unsubscribe
      title: SubscriptionMethod
    common_Address:
      type: string
      description: Master account or subaccount address.
      title: Address
    notifications_NotificationsSubscription:
      type: object
      properties:
        type:
          type: string
          enum:
            - notification
        user:
          $ref: '#/components/schemas/common_Address'
      required:
        - type
        - user
      title: NotificationsSubscription
    notifications_SubscribeNotifications:
      type: object
      properties:
        method:
          $ref: '#/components/schemas/common_SubscriptionMethod'
        subscription:
          $ref: '#/components/schemas/notifications_NotificationsSubscription'
      required:
        - method
        - subscription
      title: SubscribeNotifications

```