Skip to main content

Get Notifications

GET /notifications

Description

Returns the authenticated user's notifications, including the unread counters.

Request Parameters

Requires Authentication: true

QUERY PARAMS

NameTypeRequiredDescription
pagenumberNoPage number. Defaults to 1.
maxPageSizenumberNoPage size. The API caps it at the shared max page size.
readbooleanNoOptional filter for read or unread notifications. Accepts common truthy and falsy strings.

Usage Example

await axios.get("https://api.daykeeper.app/notifications?read=false", {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Success Response

{
"message": "notifications fetched successfully",
"data": [
{
"_id": "67d9d8abcc9e4db02fca3001",
"type": "post_like",
"seen": false,
"route": "/post/67d9c0d4cc9e4db02fca1001"
}
],
"page": 1,
"totalPages": 1,
"unreadCount": 4,
"hasUnread": true
}

Error Response

CodeDescription
401Missing or invalid access token
500Server error