Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sam-shervin/space7/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Returns a paginated list of notifications for the currently authenticated user, along with the total count of unread notifications.

Endpoint

GET /api/notifications
Requires authentication

Request

Query parameters

page
number
Page number for pagination. Defaults to 1.
limit
number
Number of notifications to return per page. Defaults to 30.

Response

Returns a NotificationsResponse object.
notifications
Notification[]
Array of notification objects.
total
number
Total number of notifications for the user.
page
number
Current page number.
totalPages
number
Total number of pages available.
unreadCount
number
Total number of unread notifications across all pages.

Example

TypeScript
import { fetchWithAuth } from "./fetchWithAuth";

async function getNotifications(
  page: number = 1,
  limit: number = 30,
) {
  const res = await fetchWithAuth(
    `/api/notifications?page=${page}&limit=${limit}`,
    {
      method: "GET",
      headers: {
        "Content-Type": "application/json",
      },
    },
  );

  const data = await res.json();

  if (!res.ok) {
    throw new Error(data.error || "Failed to fetch notifications");
  }

  return data; // NotificationsResponse
}

Build docs developers (and LLMs) love