Notes API Documentation

A comprehensive guide to the partner notes feature for sharing private messages

Overview

The Notes API enables connected partners to share private notes and messages with each other. This feature provides a dedicated communication channel where partners can leave thoughtful messages, reminders, and important notes for each other to see. Notes can be prioritized, categorized, and expire after a certain time if desired.

Key Features

  • Create and send notes to your partner
  • View received and sent notes
  • Track read status of notes
  • Filter by read/unread status
  • Pin important notes for easy access
  • Set priority levels and categories
  • Optional expiration dates for time-sensitive notes

API Documentation

Base URL: api.wecompleteapp.com/api/users/user/:userId/notes

POST api.wecompleteapp.com/api/users/user/:userId/notesCreate a Note

Creates a new note to send to your partner. The partner is automatically determined based on your connection.

Request Body:

{
  "content": "Don't forget our dinner reservation at 7pm tonight!",
  "title": "Dinner Reminder",
  "priority": "High",
  "category": "reminder",
  "expiresAt": "2023-10-25T23:59:59Z"
}

Response (200 OK):

{
  "success": true,
  "noteId": "notes_abcdef123456",
  "message": "Note created successfully"
}
GET api.wecompleteapp.com/api/users/user/:userId/notesGet Notes

Retrieves notes based on specified type (received or sent).

Query Parameters:

  • type - "received" (default) or "sent"
  • includeRead - "true" (default) or "false" (only unread)

Example: GET api.wecompleteapp.com/api/users/user/:userId/notes?type=received&includeRead=false

Response (200 OK) for Received Notes:

{
  "notes": [
    {
      "_id": "note_abc123",
      "senderId": "user_789xyz",
      "receiverId": "user_123456", 
      "content": "Don't forget our dinner reservation at 7pm tonight!",
      "title": "Dinner Reminder",
      "isRead": false,
      "isPinned": false,
      "createdAt": 1686067200000,
      "priority": "High",
      "category": "reminder",
      "expiresAt": 1686153600000,
      "sender": {
        "id": "user_789xyz",
        "name": "Alex Johnson",
        "image": "https://example.com/profile.jpg"
      }
    }
  ],
  "unreadCount": 1
}
GET api.wecompleteapp.com/api/users/user/:userId/notes/{noteId}Get Note by ID

Retrieves a single note by its ID. The user must have permission to view the note.

Path Parameters:

  • noteId - The ID of the note to retrieve

Response (200 OK):

{
  "_id": "note_abc123",
  "senderId": "user_789xyz",
  "receiverId": "user_123456",
  "content": "Don't forget our dinner reservation at 7pm tonight!",
  "title": "Dinner Reminder",
  "isRead": false,
  "isPinned": false,
  "createdAt": 1686067200000,
  "priority": "High",
  "category": "reminder",
  "expiresAt": 1686153600000,
  "sender": {
    "id": "user_789xyz",
    "name": "Alex Johnson",
    "image": "https://example.com/profile.jpg"
  }
}

Response (404 Not Found):

{
  "error": "Note not found",
  "code": "NOTE_NOT_FOUND"
}
PATCH api.wecompleteapp.com/api/users/user/:userId/notes/{noteId}Mark Note as Read

Marks a note as read.

Request Body:

{
  "action": "mark-read"
}

Response (200 OK):

{
  "success": true,
  "message": "Note marked as read"
}
PATCH api.wecompleteapp.com/api/users/user/:userId/notes/{noteId}Pin/Unpin Note

Pins or unpins a note for quick access.

Request Body:

{
  "action": "toggle-pin",
  "isPinned": true
}

Response (200 OK):

{
  "success": true,
  "message": "Note pinned"
}
DELETE api.wecompleteapp.com/api/users/user/:userId/notes/{noteId}Delete a Note

Permanently deletes a note.

Response (200 OK):

{
  "success": true,
  "message": "Note deleted successfully"
}
GET api.wecompleteapp.com/api/users/user/:userId/notes?type=received&includeRead=falseGet Unread Note Count

Returns unread notes with a count for easy badge display.

Response (200 OK):

{
  "notes": [...],
  "unreadCount": 5
}
GET api.wecompleteapp.com/api/users/user/:userId/notes?type=by-senderGet Notes by Sender

Retrieves all notes sent by the current user.

Query Parameters:

  • type - Must be "by-sender"

Response (200 OK):

{
  "notes": [
    {
      "_id": "note_abc123",
      "senderId": "user_789xyz",
      "receiverId": "user_123456",
      "content": "Don't forget our dinner reservation!",
      "title": "Dinner Reminder",
      "isRead": false,
      "isPinned": false,
      "createdAt": 1686067200000,
      "priority": "High",
      "category": "reminder",
      "expiresAt": 1686153600000
    },
    // ... more notes
  ]
}
PATCH api.wecompleteapp.com/api/users/user/:userId/notes/{noteId}Add Reaction to Note

Adds a reaction emoji or text to a note.

Request Body:

{
  "action": "add-reaction",
  "reaction": "❤️" 
}

Response (200 OK):

{
  "success": true,
  "message": "Reaction added to note",
  "reaction": "❤️"
}

Data Models

Note

interface Note {
  // Core Properties
  _id: string;
  senderId: string;
  receiverId: string;
  content: string;
  title?: string;
  
  // Status Properties
  isRead: boolean;
  isPinned: boolean;
  
  // Organization & Priority
  priority?: 'Low' | 'Medium' | 'High';
  category?: string;
  
  // Timing
  createdAt: number;
  expiresAt?: number;
  
  // Interaction
  reaction?: string;  // Emoji or text reaction from recipient
  
  // Populated in API responses (not stored)
  sender?: {
    id: string;
    name: string;
    image?: string;
  };
  receiver?: {
    id: string;
    name: string;
    image?: string;
  };
}

Note Response

interface NotesResponse {
  // For received notes
  notes: Array<Note>;
  unreadCount?: number; // Only included for received notes
}

Error Handling

400 - Validation Error

{
  "error": "Missing required parameters: receiverId and content are required",
  "code": "validation_error"
}

404 - Not Found

{
  "error": "Note not found",
  "code": "NOTE_NOT_FOUND"
}

401 - Unauthorized

{
  "error": "You are not authorized to mark this note as read",
  "code": "UNAUTHORIZED"
}

403 - Forbidden

{
  "error": "You must be connected partners to share notes",
  "code": "NOT_PARTNERS"
}

Best Practices

Guidelines for Effective Note Usage

  • Use titles for easier organization and scanning
  • Set appropriate priority levels to help your partner prioritize
  • Use categories consistently for better filtering
  • Set expiration dates for time-sensitive content
  • Pin important notes that need to remain visible
  • Check for unread notes regularly to stay in sync
  • Use reactions to quickly acknowledge or respond to notes without creating new ones

Example Use Cases

  • Sharing daily affirmations and words of encouragement
  • Reminders for important appointments or events
  • Love notes and expressions of appreciation
  • Coordinating schedules and logistics
  • Saving conversation topics for when you're together
  • Sharing thoughts when your partner is busy or unavailable
  • Using reactions to acknowledge tasks or express feelings about a message