Skip to main content

GET /api/notifications

Returns the authenticated user’s notifications.
Requires authentication.

Query Parameters

ParameterDefaultDescription
page1Page number
limit20Items per page

Notification Types

TypeTrigger
tag_postUser tagged in a post
tag_recipeUser tagged in a recipe
mention_post_commentUser @mentioned in a post comment
mention_recipe_commentUser @mentioned in a recipe comment

Response (200)

{
  "data": [
    {
      "id": "uuid",
      "type": "mention_post_comment",
      "actor": {
        "id": "uuid",
        "username": "janedoe",
        "avatarUrl": "https://..."
      },
      "contentType": "post",
      "contentId": "uuid",
      "commentId": "uuid",
      "isRead": false,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": { ... }
}

GET /api/notifications/unread-count

Returns the count of unread notifications.

Response (200)

{
  "count": 5
}

PATCH /api/notifications/read

Marks notifications as read.

Request Body

{
  "notificationIds": ["uuid1", "uuid2"]
}

Response (200)

{
  "message": "Notifications marked as read"
}