Notifications

This guide will help you retrieve Account related notifications.


When an Account interacts with you or your content, the activity is recorded and notification detailing the interaction is stored in the Lens API.

Notification types

There are various types of notifications, each with a slightly different structure, requiring individual handling. The available notification types include:

  • CommentNotification - when someone comments on your post

  • FollowNotification - when someone follows you

  • MentionNotification - when someone mentions you in a post

  • RepostNotification - when someone reposts your post

  • QuoteNotification - when someone quotes your post

  • ReactionNotification - when someone adds reaction to your post

At any given time new notification types may be added to the Lens API. Make sure you handle gracefully unknown notification types to avoid breaking your app.

Notifications Query

The Lens API offers a notifications query to retrieve notifications for an Account.

You MUST be authenticated as Account Owner or Account Manager to make this request.

query Notifications(  $request: NotificationRequest!) {  notifications(request: {    # optional, defaults to Global Graph    # forGraphs: [EvmAddress!]    forGraphs: ["0x1234..."]
    # optional, defaults to the Global Feed address    # forFeeds: [EvmAddress!]
    filter: {      # optional, default to any apps      # apps: [EvmAddress!]
      # optional, defaults to all notifications      # notificationTypes: [NotificationType!]
      # optional, include notification from low score accounts, defaults to false      includeLowScore: false
      # optional, defaults to true      timeBasedAggregation: true    }
    # optional order    # orderBy: NotificationOrderBy  }) {    items {      ... on ReactionNotification {        __typename        id        reactions {          account {            address          }          reactions {            reaction            reactedAt          }        }        post {          id        }      }
      ... on CommentNotification {        __typename        id        comment {          id        }      }
      ... on RepostNotification {        __typename        id        reposts {          repostId          repostedAt          account {            address          }        }        post {          id        }      }      ... on QuoteNotification {        __typename        id        quote {          id        }      }      ... on FollowNotification {        __typename        id        followers {          followedAt          account {            address          }        }      }      ... on MentionNotification {        __typename        id        post {          id        }      }    }    pageInfo {      next      prev    }  }}

The query supports pagination. For more information on pagination, refer to this guide.