newOS for Developers

Back to Skill Portal

Mood Management

Folders, spaces, access control, and content organization

Overview

Moods (also called folders or spaces) are the primary organizational unit in Newgraph. They can contain posts, images, files, and other content. Moods support access control, allowing you to create private spaces with granular permissions.

Note: In the API, moods are called mood, while in the UI they're often called "folders" or "spaces". Thefolder.ts actionswrap all mood-related endpoints.

Available Skills

Create a new folder or space for organizing content

POST /mood

Add content (posts, images, files) to a mood

PUT /mood/attach/post

Grant or request access to private moods

POST /mood/access/grantPOST /mood/access/request

Create or retrieve a direct message folder between two users

GET /mood/oneonone/{id}
Rate Moodaction docs
beginnerComing Soon

Vote on a mood to increase its ranking

POST /mood/rate

Paginated content listing with sorting options

GET /mood/postsGET /mood/attachments

Mood Data Model

See the full type definition in Contracts → MoodReadResponse

MoodReadResponse {
  id: string;
  title: string;
  description?: string;
  author: UserReadPublicResponse;  // See /contracts#UserReadPublicResponse
  isPrivate: boolean;
  posts?: PostReadResponse[];      // See /contracts#PostReadResponse
  postsCount?: number;
  coverContentUrl?: string;
  stakeToAccess?: number;
  created: string;
  updated: string;
}

Cache & Edge Patterns

Moods are cached in IndexedDB. Learn about caching in Infrastructure → Cache

// Edge patterns for mood relationships
folder+{folderId}+attachment+post   // Posts in a folder
folder+{folderId}+access+user       // Users with access
user+{userId}+author+folder         // Folders by author

// See /actions/folder#Edge-Patterns for full documentation