Habits

Habits represent recurring behaviors you want to build or maintain. Each habit can be tracked with daily logs, configured with cues and stacking, and tied to notification schedules.

GET /api/v1/habits

List all habits for the authenticated user.

Response

[
  {
    "id": "clx9a0b1c...",
    "name": "Morning meditation",
    "description": "10 minutes of mindfulness meditation",
    "importance": "High",
    "cue_time": "07:00",
    "cue_context": "After waking up",
    "habit_stack": "After brushing teeth",
    "frequency": "daily",
    "custom_days": null,
    "estimated_minutes": 10,
    "notify_enabled": true,
    "notify_time": "07:00",
    "bucket_id": "clx7g8h9i...",
    "createdAt": "2026-01-01T10:00:00.000Z",
    "updatedAt": "2026-03-20T10:00:00.000Z"
  }
]

POST /api/v1/habits

Create a new habit.

Request Body

{
  "name": "Morning meditation",
  "description": "10 minutes of mindfulness meditation",
  "importance": "High",
  "cue_time": "07:00",
  "cue_context": "After waking up",
  "habit_stack": "After brushing teeth",
  "frequency": "daily",
  "custom_days": null,
  "estimated_minutes": 10,
  "notify_enabled": true,
  "notify_time": "07:00",
  "bucket_id": "clx7g8h9i..."
}

Fields

FieldTypeRequiredDescription
namestringYesThe habit name
descriptionstringNoDetailed description of the habit
importancestringNoOne of: Low, Medium, High
cue_timestringNoTime of day cue (HH:MM format)
cue_contextstringNoContextual cue for the habit
habit_stackstringNoHabit stacking anchor (e.g. "After brushing teeth")
frequencystringNoOne of: daily, weekdays, weekends, weekly, custom
custom_daysstring[]NoRequired when frequency is custom. Array of day names.
estimated_minutesnumberNoEstimated time in minutes
notify_enabledbooleanNoWhether notifications are enabled
notify_timestringNoNotification time (HH:MM format)
bucket_idstringNoAssociated life bucket ID

Response

Returns the created habit object.

PATCH /api/v1/habits/:id

Update an existing habit. Only include the fields you want to change.

Request Body

{
  "importance": "Medium",
  "notify_enabled": false
}

All fields from the create endpoint are accepted. Only provided fields will be updated.

Response

Returns the updated habit object.

DELETE /api/v1/habits/:id

Permanently delete a habit and all its associated logs.

Response

{
  "success": true
}

POST /api/v1/habits/:id/log

Log a habit completion or skip for a specific date.

Request Body

{
  "completed_date": "2026-03-22",
  "notes": "Felt great today",
  "skipped": false,
  "skip_reason": null
}

Fields

FieldTypeRequiredDescription
completed_datestringYesThe date of the log entry (ISO 8601 date)
notesstringNoOptional notes about the session
skippedbooleanNoWhether the habit was intentionally skipped
skip_reasonstringNoReason for skipping (when skipped is true)

Response

Returns the created habit log object.