Embedding Mood Tracking
Example implementation for apps.
Mood Tracking allows your users to log how they’re feeling and view their emotional history over time. It’s lightweight, easy to implement, and fits naturally into daily routines, onboarding flows, dashboards, and wellbeing check-ins.
This page shows how to embed mood tracking inside your app using the therappai API.
How Mood Tracking Works
A mood entry consists of:
a rating (number)
an optional note
an auto-generated timestamp
Your application:
Collects the user’s mood input
Sends it to the API
Fetches historical moods as needed
Visualises or processes the data however you want
The API handles storage so you don’t need to maintain your own mood database.
1. Create a Mood Entry
Your UI collects the user’s rating (e.g., 1–5) and optional notes.
Example body:
{
"mood": 2,
"note": "Feeling stressed after work."
}Send this to:
POST /moods/
Authorization: Bearer ACCESS_TOKENA successful response stores the mood entry for that user.
2. Fetch Mood History
To display past mood entries in charts, heatmaps, or summaries, call:
GET /moods/
Authorization: Bearer ACCESS_TOKENThis returns a list of the user’s previous mood check-ins, including timestamps and notes.
You can use this data to build:
mood calendars
weekly insights
streaks
“how you’ve been feeling” widgets
trend graphs
3. Build a Mood Check-In UI
Developers typically create a simple daily check-in component using:
Rating Control
slider
set of emojis
numbered scale
colour-coded options
Optional Notes
A small textbox:
“What’s contributing to this mood?”
“Anything you’d like to note?”
Submit Button
Sends the call to /moods/.
This pairs well with your Daily Tasks, AI Therapy, or Content UI.
4. Visualise Mood Trends
Mood history is ideal for:
line or bar charts
weekly summaries
heatmaps
day-by-day check-ins
aggregated insights
You build the visuals — the API just gives you the data.
5. Suggested Pairings
Mood tracking integrates naturally with other therappai features:
AI Therapy
If a user logs a very low mood, show a supportive therapist message.
Tailor conversation content based on trends.
Content Library
Recommend specific CBT/DBT exercises related to the user’s mood patterns.
Daily Tasks
Offer tasks designed to help stabilise or improve mood.
Crisis Buddy
If the user logs severe moods, make supportive options available.
Minimum Viable Mood Tracking Integration
Build a mood check-in UI
POST mood to
/moods/GET mood history
Visualise it in your app
Use it to enhance therapy or content recommendations
That’s all you need to create a fully functional mood tracking feature.
Last updated

