Get App Notifications
Endpoint
URL: /:projectId/app-notifications
Method: GET
Authentication Required: Yes
Description
Retrieve a paginated list of app notifications for the authenticated user, ordered by most recent first.
Request
Headers
Header | Type | Required | Description |
---|---|---|---|
Authorization | string | Yes | Bearer token for authentication. |
Query Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
page | number | No | 1 | The page number (must be a whole number >= 1). |
limit | number | No | 5 | Number of notifications to return (max 50). |
Example Request
GET /proj1234/app-notifications?page=2&limit=10
Authorization: Bearer <ACCESS_TOKEN>
Response
Success Response (200 OK)
[
{
"id": "notif123",
"userId": "user_abc",
"projectId": "proj1234",
"type": "new-follow",
"action": "open-profile",
"metadata": {
"initiatorId": "user_xyz",
"initiatorName": "Jane",
"initiatorUsername": "jane123",
"initiatorAvatar": "https://example.com/avatar.jpg"
},
"createdAt": "2024-07-10T10:00:00.000Z",
"updatedAt": "2024-07-10T10:00:00.000Z"
}
]
Error Responses
Invalid Page (400 Bad Request)
{
"error": "Invalid request: 'page' must be a whole number greater than 0",
"code": "app-notification/invalid-page"
}
Invalid Limit (400 Bad Request)
{
"error": "Invalid request: limit must be a number",
"code": "app-notification/invalid-limit"
}
Server Error (500 Internal Server Error)
{
"error": "Internal server error.",
"code": "app-notification/server-error",
"details": "<Error message>"
}
Notes
- Requires authentication.
- Pagination is supported via
page
andlimit
query parameters. - Max value for
limit
is 50.