All endpoints require a JWT token in the Authorization header:
Authorization: Bearer <token>
POST /auth/anonymous
- Creates anonymous user session
- Returns: { token: string, userId: string }
POST /auth/register
- Upgrades anonymous account to registered user
- Body: { email: string, password: string }
POST /moods
- Records new mood entry
- Body: {
moodType: "happy" | "energetic" | "content" | "mellow" | "down",
intensity: number (1-5),
location?: { latitude: number, longitude: number },
timestamp: string (ISO-8601)
}
GET /moods
- Retrieves user's mood history
- Query params:
- from: string (ISO-8601)
- to: string (ISO-8601)
- limit: number
- offset: number
GET /moods/stats
- Returns aggregated mood statistics
- Query params:
- timeframe: "day" | "week" | "month" | "year"
- timezone: string
GET /analytics/global
- Returns global mood trends
- Query params:
- resolution: "hour" | "day" | "week"
- region?: string
- from: string (ISO-8601)
- to: string (ISO-8601)
GET /analytics/regional
- Returns mood data by region
- Query params:
- region: string
- resolution: "hour" | "day" | "week"
GET /locations/regions
- Returns list of available regions
GET /locations/trends
- Returns mood trends by location
- Query params:
- latitude: number
- longitude: number
- radius: number (km)
Anonymous users: 60 requests/hour
Registered users: 1000 requests/hour
json
{
"error": {
"code": "string",
"message": "string",
"details": Object
}
}
Sign up for Moodgram's MVP:
Be part of a groundbreaking project to map the emotional fabric of humanity. Together, we're creating the world's first real-time emotional atlas.