newOS for Developers
Back to Lists & Rankings
Access Grantees
Users with access to a private mood
intermediate
GET /mood/access/granteesOverview
Private moods can grant access to specific users. This endpoint lists all users who have been granted access to a particular mood.
Only the mood owner can query grantees. Grantees see the mood as if it were public.
API Endpoint
GET
/mood/access/granteesQuery Parameters:
moodId— Target mood/folder ID (required)page— Pagination cursor
Usage Example
import { getGrantees } from "@newgraph-signals/actions/folder";
// List users with access to a private mood
const grantees = getGrantees({ moodId: "mood-123" });
// Grant access to a user
import { grantAccess } from "@newgraph-signals/actions/folder";
await grantAccess({
moodId: "mood-123",
userId: "user-456"
});
// Revoke access
import { revokeAccess } from "@newgraph-signals/actions/folder";
await revokeAccess({
moodId: "mood-123",
userId: "user-456"
});Access Control Flow
┌───────────────┐
│ Private Mood │ ──▶ privacy: "private"
└───────┬───────┘
│ grantAccess()
▼
┌───────────────┐
│ Grantees │ ──▶ [user-1, user-2, ...]
└───────────────┘
│
▼
// Edge pattern: folder+{moodId}+access+userResponse Schema
// PagedResponse<AccessGrantResponse>
{
value: [
{
user: {
id: string;
username: string;
displayName: string;
contentUrl: string;
};
grantedAt: string; // When access was granted
grantedBy: { // Who granted access
id: string;
username: string;
};
}
],
done: boolean;
page: string;
}