Skip to main content

Endpoint

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

Authentication

Authorization
string
required
Bearer token for authentication. Get this from the Login endpoint.

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Achievements grouped by status
Each achievement object contains:

Response Example

{
  "success": true,
  "data": {
    "unlocked": [
      {
        "id": "first_meal",
        "title": "First Steps",
        "description": "Log your first meal",
        "icon": "🎯",
        "color": "#22c55e",
        "category": "diary",
        "rarity": "common",
        "requirement": {
          "type": "count",
          "target": 1,
          "metric": "meals_logged"
        },
        "reward": {
          "points": 10,
          "badge": "first_meal_badge"
        },
        "progress": 1,
        "unlocked": true,
        "unlockedAt": "2024-03-01T10:30:00Z",
        "hidden": false
      }
    ],
    "inProgress": [
      {
        "id": "week_streak",
        "title": "Consistent Logger",
        "description": "Log meals for 7 days in a row",
        "icon": "🔥",
        "color": "#f59e0b",
        "category": "streak",
        "rarity": "rare",
        "requirement": {
          "type": "streak",
          "target": 7,
          "metric": "days_streak"
        },
        "reward": {
          "points": 50,
          "badge": "week_streak_badge"
        },
        "progress": 4,
        "unlocked": false,
        "hidden": false
      }
    ],
    "locked": [
      {
        "id": "master_logger",
        "title": "Master Logger",
        "description": "Log 100 meals",
        "icon": "👑",
        "color": "#8b5cf6",
        "category": "diary",
        "rarity": "epic",
        "requirement": {
          "type": "count",
          "target": 100,
          "metric": "meals_logged"
        },
        "reward": {
          "points": 200,
          "badge": "master_logger_badge"
        },
        "progress": 0,
        "unlocked": false,
        "hidden": false
      }
    ]
  }
}

Achievement Categories

CategoryDescription
diaryRelated to logging meals and symptoms
streakRelated to consecutive day achievements
explorationRelated to trying new foods
socialRelated to community interactions
specialSpecial or seasonal achievements

Achievement Metrics

MetricDescription
first_loginUser’s first login
meals_loggedTotal meals logged
symptoms_loggedTotal symptoms logged
days_loggedTotal days with entries
days_streakConsecutive days with entries
foods_testedUnique foods tested
problematic_foods_markedFoods marked as problematic
safe_foods_foundFoods marked as safe
customCustom achievement logic

Notes

  • Requires authentication via Bearer token
  • Progress is automatically tracked based on user activity
  • Hidden achievements won’t show details until unlocked
  • Achievement progress is updated in real-time as users interact with the app

Build docs developers (and LLMs) love