Partner Data API Documentation

Access your partner's shared data when both users have an active connection

Overview

The Partner Data API provides a secure way for connected partners to access each other's shared data. This bidirectional data sharing only works when both users have established an active connection. Partners can access each other's basic profile information, moods, events, and shared relationship memories.

Key Features

  • Access partner's basic profile information (name, image, etc.)
  • Access partner's mood entries with intensity and timestamps
  • View shared calendar events between partners
  • Retrieve relationship memories
  • Combine multiple data types in a single request
  • Automatic access control based on connection status

API Documentation

Base URL: api.wecompleteapp.com/api/users/user/:userId/pairing/partner-data

POST api.wecompleteapp.com/api/users/user/:userId/pairing/partner-dataGet Partner Data

Retrieves data shared by your connected partner.

Request Body:

{
  "action": "get-moods"
}

Available Actions:

ActionDescription
get-profilePartner's basic profile information
get-moodsPartner's mood entries
get-eventsShared calendar events
get-memoriesRelationship memories
get-allAll data types combined

Response (200 OK) for get-profile:

{
  "partner": {
    "_id": "user_456",
    "name": "Jane Smith",
    "email": "jane@example.com",
    "image": "https://example.com/profile.jpg",
    "gender": "female",
    "city": "San Francisco",
    "country": "USA",
    "interests": ["yoga", "reading", "hiking"],
    "languages": ["en", "fr"],
    "lastActiveTimestamp": 1717020800,
    "isActive": true,
    "profileCompleteness": 95
  }
}

Response (200 OK) for get-moods:

{
  "partner": {
    "_id": "user_456",
    "name": "Jane Smith",
    "image": "https://example.com/profile.jpg",
    "lastActiveTimestamp": 1717020800,
    "isActive": true
  },
  "moods": [
    {
      "mood": "Happy",
      "intensity": 8,
      "createdAt": 1717020800,
      "reason": "Got a promotion at work",
      "note": "Really excited about the new role"
    },
    {
      "mood": "Relaxed",
      "intensity": 6,
      "createdAt": 1717007400
    }
  ]
}

Response (200 OK) for get-all:

{
  "partner": {
    "_id": "user_456",
    "name": "Jane Smith",
    "email": "jane@example.com",
    "image": "https://example.com/profile.jpg",
    "gender": "female",
    "city": "San Francisco",
    "country": "USA",
    "interests": ["yoga", "reading", "hiking"],
    "languages": ["en", "fr"],
    "lastActiveTimestamp": 1717020800,
    "isActive": true,
    "profileCompleteness": 95
  },
  "moods": [...],
  "events": [...],
  "memories": [...]
}

Data Models

Partner Profile

interface PartnerProfile {
  _id: string;
  name: string;
  email?: string;
  image?: string;
  gender?: string;
  city?: string;
  country?: string;
  interests?: string[];
  languages?: string[];
  lastActiveTimestamp?: number;
  isActive?: boolean;
  profileCompleteness?: number;
}

Mood

interface Mood {
  mood: string;
  intensity?: number; // 1-10 scale
  createdAt: number; // Unix timestamp
  reason?: string;
  note?: string;
  images?: string[];
  tags?: string[];
}

Event

interface Event {
  title: string;
  description?: string;
  startDate: string; // YYYY-MM-DD format
  endDate?: string;
  startTime?: string; // HH:MM format
  endTime?: string;
  eventType?: 'date' | 'meeting' | 'reminder' | 'traveling' | 'task' | 'other';
  location?: string;
  importanceLevel?: 'Low' | 'Medium' | 'High';
}

Memory

interface Memory {
  title: string;
  description?: string;
  date: string; // YYYY-MM-DD format
  location?: string;
  latitude?: number;
  longitude?: number;
  images: string[]; // URLs to images
  memoryType?: string;
  createdAt: string; // YYYY-MM-DD format
}

Error Handling

400 - Bad Request

{
  "error": "Missing action parameter",
  "code": "MISSING_PARAMETER"
}

403 - Forbidden

{
  "error": "No active partner connection",
  "code": "NOT_PAIRED",
  "message": "Connect with a partner to use this feature"
}

404 - Not Found

{
  "error": "Partner profile not found",
  "code": "PARTNER_NOT_FOUND",
  "message": "Partner profile not found"
}

500 - Server Error

{
  "error": "Internal server error",
  "code": "INTERNAL_ERROR",
  "message": "Failed to process partner data request"
}