Skip to main content

Get Unnotified Achievements

Retrieve achievements that were recently unlocked but not yet shown to the user.

Endpoint

curl -X GET 'https://api.ceboelha.com/insights/achievements/unnotified' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Authentication

Authorization
string
required
Bearer token for authentication

Response

success
boolean
required
Indicates if the request was successful
data
array
required
Array of achievement objects (same structure as List Achievements)

Response Example

{
  "success": true,
  "data": [
    {
      "id": "first_meal",
      "title": "First Steps",
      "description": "Log your first meal",
      "icon": "🎯",
      "color": "#22c55e",
      "reward": {
        "points": 10,
        "badge": "first_meal_badge"
      },
      "unlocked": true,
      "unlockedAt": "2024-03-01T10:30:00Z"
    }
  ]
}

Mark Achievement as Notified

Mark an achievement notification as seen by the user.

Endpoint

curl -X POST 'https://api.ceboelha.com/insights/achievements/first_meal/notified' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Path Parameters

id
string
required
Achievement ID (e.g., “first_meal”, “week_streak”)

Authentication

Authorization
string
required
Bearer token for authentication

Response

success
boolean
required
Indicates if the request was successful
message
string
required
Success message

Response Example

{
  "success": true,
  "message": "Achievement marked as notified"
}

Recalculate Achievement Progress

Force a recalculation of all achievement metrics for the authenticated user.

Endpoint

curl -X POST 'https://api.ceboelha.com/insights/achievements/recalculate' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Authentication

Authorization
string
required
Bearer token for authentication

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Recalculation results
message
string
required
Summary message

Response Example

{
  "success": true,
  "data": {
    "newlyUnlocked": ["week_streak", "explorer"]
  },
  "message": "Recalculated achievements. 2 newly unlocked."
}

Manually Unlock Achievement

Manually unlock a custom or easter egg achievement.

Endpoint

curl -X POST 'https://api.ceboelha.com/insights/achievements/easter_egg_1/unlock' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

Path Parameters

id
string
required
Achievement ID to unlock

Authentication

Authorization
string
required
Bearer token for authentication

Response

success
boolean
required
Indicates if the request was successful
data
object
Unlocked achievement object (if successful)
message
string
required
Success or error message

Response Example

Success:
{
  "success": true,
  "data": {
    "id": "easter_egg_1",
    "title": "Secret Achievement",
    "description": "You found the hidden secret!",
    "icon": "🥚",
    "reward": {
      "points": 100
    }
  },
  "message": "Achievement unlocked!"
}
Error (already unlocked):
{
  "success": false,
  "error": "Achievement not found or already unlocked"
}

Notes

  • All endpoints require authentication via Bearer token
  • Unnotified achievements should be displayed to users as celebration notifications
  • Use the recalculate endpoint sparingly, as it performs heavy database queries
  • Manual unlock is typically used for easter eggs or special events
  • Achievement progress is automatically updated when users log meals, symptoms, or perform other tracked activities

Build docs developers (and LLMs) love