Social

Notification Object JSON Example

A JSON example for an in-app or push notification — includes notification type, actor, action subject, deep-link, read status, and grouping metadata.

{
  "id": "notif_5pRtVqKz9m",
  "recipientId": "usr_9k2mXpQr4t",
  "type": "post.liked",
  "actor": {
    "id": "usr_Wx3yNmLp7q",
    "username": "priya.sharma",
    "displayName": "Priya Sharma",
    "avatarUrl": "https://cdn.example.com/avatars/usr_Wx3yNmLp7q.jpg"
  },
  "subject": {
    "type": "post",
    "id": "post_8vKqNmTr5j",
    "preview": "Just deployed our new JSON API..."
  },
  "message": "Priya Sharma liked your post",
  "deepLink": "/posts/post_8vKqNmTr5j",
  "isRead": false,
  "isGrouped": false,
  "groupCount": 1,
  "priority": "normal",
  "channel": "in-app",
  "createdAt": "2025-06-01T11:04:22Z",
  "expiresAt": null
}

Field Reference

idstringrequiredUnique notification identifier
recipientIdstringrequiredUser ID who should receive this notification
typestringrequiredNotification type in dot notation: entity.action (post.liked, comment.replied, follow.new)
actorobjectoptionalUser who triggered the notification — absent for system notifications
subjectobjectoptionalThe content item the notification is about — post, comment, product, etc.
deepLinkstringoptionalIn-app path or URL to navigate to when the notification is tapped
isReadbooleanrequiredWhether the user has read/dismissed this notification
prioritystringoptionalDelivery priority: normal, high, or urgent (affects push delivery speed)
channelstringrequiredDelivery channel: in-app, push, email, or sms

Variants

GroupedMultiple likes grouped into a single notification.
{
  "id": "notif_grp_001",
  "recipientId": "usr_9k2mXpQr4t",
  "type": "post.liked",
  "actor": null,
  "message": "Priya, Amit, and 12 others liked your post",
  "deepLink": "/posts/post_8vKqNmTr5j",
  "isRead": false,
  "isGrouped": true,
  "groupCount": 14,
  "actors": [
    {
      "id": "usr_Wx3yNmLp7q",
      "username": "priya.sharma",
      "avatarUrl": "..."
    },
    {
      "id": "usr_KmT4nPqR8v",
      "username": "amit.patel",
      "avatarUrl": "..."
    }
  ],
  "priority": "normal",
  "channel": "in-app",
  "createdAt": "2025-06-01T13:00:00Z"
}

Common Use Cases

  • Rendering a notification feed sorted by createdAt with unread count badge
  • Sending push notifications via Firebase Cloud Messaging (FCM) or APNs
  • Marking notifications as read via PATCH /notifications/:id
notificationpushin-appreal-timealert

Validate or format this JSON

Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.

Frequently Asked Questions

Group by type + subject.id within a time window (e.g. 1 hour). When a new matching notification arrives, update the group's actor list and groupCount rather than creating a new record. Show 'Priya and 3 others liked your post' instead of 4 separate notifications.

Store a snapshot of the actor's display name and avatar URL at the time the notification was created. This avoids a join on every notification render and ensures the notification still makes sense if the actor later changes their name or deletes their account.

Related JSON Examples