Custom JSON Import Format

Import data from any habit tracking app by preparing a JSON file in the HabitGrip format.

Minimal Example

The simplest valid file — one habit with one completion log:

{
  "activities": [
    {
      "_temp_id": "a1",
      "type": "habit",
      "name": "Drink Water",
      "status": "active",
      "unit_type": "boolean",
      "start_date": "2025-01-01",
      "is_recurring": true
    }
  ],
  "activity_logs": [
    {
      "_temp_activity_id": "a1",
      "start_date": "2025-01-15",
      "status": "COMPLETED"
    }
  ]
}

Full Example

A complete file using all supported entity types:

{
  "activities": [
    {
      "_temp_id": "a1",
      "type": "habit",
      "name": "Drink Water",
      "description": "Drink at least 8 glasses",
      "icon": "water-outline",
      "color": "#3B82F6",
      "status": "active",
      "priority": 1,
      "unit_type": "numeric",
      "target_value": 8,
      "unit_label": "glasses",
      "goal_direction": "at_least",
      "start_date": "2025-01-01",
      "start_time_period": "morning",
      "is_recurring": true,
      "end_condition_type": "infinite"
    },
    {
      "_temp_id": "a2",
      "type": "habit",
      "name": "Morning Meditation",
      "status": "active",
      "unit_type": "timer",
      "target_value": 600,
      "unit_label": "seconds",
      "goal_direction": "at_least",
      "start_date": "2025-01-01",
      "start_time": "07:00",
      "is_recurring": true,
      "end_condition_type": "infinite"
    },
    {
      "_temp_id": "a3",
      "type": "task",
      "name": "Buy groceries",
      "status": "active",
      "unit_type": "checklist",
      "checklist_json": "[\"Milk\",\"Bread\"]",
      "start_date": "2025-03-01",
      "is_recurring": false
    }
  ],
  "tags": [
    { "_temp_id": "t1", "name": "Health", "color": "#10B981", "icon": "heart-outline" },
    { "_temp_id": "t2", "name": "Mindfulness" }
  ],
  "activity_logs": [
    {
      "_temp_activity_id": "a1",
      "start_date": "2025-01-15",
      "status": "COMPLETED",
      "value": 8,
      "note": "Great day!"
    },
    {
      "_temp_activity_id": "a1",
      "start_date": "2025-01-16",
      "status": "FAILED",
      "value": 3
    },
    {
      "_temp_activity_id": "a2",
      "start_date": "2025-01-15",
      "start_time": "07:00",
      "end_time": "07:15",
      "status": "COMPLETED",
      "value": 900
    }
  ],
  "recurrence_rules": [
    {
      "_temp_activity_id": "a1",
      "rule_type": "fixed_schedule",
      "is_rollover": false,
      "value_json": "{\"period\":\"day\"}"
    },
    {
      "_temp_activity_id": "a2",
      "rule_type": "fixed_schedule",
      "is_rollover": false,
      "value_json": "{\"period\":\"week\",\"value\":[1,2,3,4,5]}"
    }
  ],
  "activity_tags": [
    { "_temp_activity_id": "a1", "_temp_tag_id": "t1" },
    { "_temp_activity_id": "a2", "_temp_tag_id": "t2" }
  ],
  "reminders": [
    {
      "_temp_activity_id": "a1",
      "trigger_type": "time_fixed",
      "fixed_time": "08:00",
      "is_enabled": true
    }
  ]
}

Schema Reference

activities (required)

Each activity represents a habit or task.

FieldTypeReqDescription
_temp_idstringYesUnique ID within this file. Used by other entities to reference this activity.
typestringYes"habit" or "task"
namestringYesDisplay name
statusstringYes"active", "archived", or "paused"
unit_typestringYes"boolean", "numeric", "timer", or "checklist"
start_datestringYesStart date in YYYY-MM-DD format
is_recurringbooleanYesWhether the activity repeats
descriptionstringNoOptional description
iconstringNoIcon name (e.g. "water-outline")
colorstringNoHex color (e.g. "#3B82F6")
prioritynumberNoPriority level (default: 1)
target_valuenumberNoGoal target (e.g. 8 for 8 glasses)
unit_labelstringNoUnit label (e.g. "glasses", "km", "pages")
checklist_jsonstringNoJSON string of checklist item labels, e.g. '["Milk","Bread"]' (for unit_type: "checklist")
goal_directionstringNo"at_least" (default) or "at_most"
start_time_periodstringNo"morning", "afternoon", "evening", or "night"
start_timestringNoSpecific time in HH:MM format
end_condition_typestringNo"infinite" (default), "fixed_date", or "repetition_count"
end_datestringNoEnd date in YYYY-MM-DD format (when end_condition_type is "fixed_date")
end_repetition_countnumberNoNumber of repetitions (when end_condition_type is "repetition_count")

tags (optional)

Tags for categorizing activities.

FieldTypeReqDescription
_temp_idstringYesUnique ID within this file
namestringYesTag name
colorstringNoHex color
iconstringNoIcon name

activity_logs (optional)

Historical completion/tracking data.

FieldTypeReqDescription
_temp_activity_idstringYesReferences an activity's _temp_id
start_datestringYesDate in YYYY-MM-DD format
statusstringYes"COMPLETED", "SKIPPED", "FAILED", "IN_PROGRESS", or "PENDING"
start_timestringNoTime in HH:MM format
end_datestringNoEnd date for timer activities
end_timestringNoEnd time for timer activities
valuenumberNoNumeric value (e.g. glasses of water, seconds for timer)
checklist_jsonstringNoJSON string of checklist state
notestringNoUser note for this entry

recurrence_rules (optional)

Schedule patterns for recurring activities.

FieldTypeReqDescription
_temp_activity_idstringYesReferences an activity's _temp_id
rule_typestringYes"one_time", "fixed_schedule", "interval", or "frequency"
is_rolloverbooleanNoWhether incomplete items roll over (default: false)
value_jsonstringYesJSON string with schedule details (see examples below)

activity_tags (optional)

Links between activities and tags.

FieldTypeReqDescription
_temp_activity_idstringYesReferences an activity's _temp_id
_temp_tag_idstringYesReferences a tag's _temp_id

reminders (optional)

Reminder settings for activities.

FieldTypeReqDescription
_temp_activity_idstringYesReferences an activity's _temp_id
trigger_typestringYes"time_fixed", "time_relative", or "location"
fixed_timestringNoTime in HH:MM format (for "time_fixed")
is_enabledbooleanNoWhether the reminder is active (default: true)

Recurrence Rule Examples

The value_json field varies based on rule_type:

Daily (every day)

{
  "rule_type": "fixed_schedule",
  "value_json": "{\"period\":\"day\"}"
}

Weekly on specific days

Days are 0–6 where 0 = Sunday, 1 = Monday, …, 6 = Saturday.

{
  "rule_type": "fixed_schedule",
  "value_json": "{\"period\":\"week\",\"value\":[1,3,5]}"
}

This schedules on Monday, Wednesday, Friday.

Monthly on specific dates

{
  "rule_type": "fixed_schedule",
  "value_json": "{\"period\":\"month_date\",\"value\":[1,15]}"
}

This schedules on the 1st and 15th of each month.

Every N days (interval)

{
  "rule_type": "interval",
  "value_json": "{\"type\":\"simple\",\"interval\":3}"
}

This repeats every 3 days.

N times per period (frequency)

{
  "rule_type": "frequency",
  "value_json": "{\"period_type\":\"WEEK\",\"times_per_period\":3}"
}

This means 3 times per week (flexible — user chooses which days).

Enum Reference

FieldValid Values
Activity typehabit, task
Activity statusactive, archived, paused
unit_typeboolean, numeric, timer, checklist
goal_directionat_least, at_most
end_condition_typeinfinite, fixed_date, repetition_count
Log statusCOMPLETED, SKIPPED, FAILED, IN_PROGRESS, PENDING
rule_typeone_time, fixed_schedule, interval, frequency
Reminder trigger_typetime_fixed, time_relative, location

Tips & Common Mistakes

  • Log status is UPPERCASE: Use COMPLETED, not completed. All other enum values are lowercase.
  • Dates must be YYYY-MM-DD: 2025-03-15 is valid. March 15, 2025 or 15/03/2025 will be rejected.
  • Times must be HH:MM: 08:00 is valid. 8:00 AM will be rejected.
  • _temp_id must be unique: Each activity and tag needs a unique _temp_id. It can be any string (e.g. a1, my-habit, uuid-123).
  • References must match: _temp_activity_idin logs, rules, tags, and reminders must match an activity's _temp_id.
  • value_json is a string: The recurrence rule value_json must be a JSON string, not a nested object. Use "{\"period\":\"day\"}", not {"period": "day"}.
  • is_recurring determines scheduling: Set to true for repeating habits/tasks. Set to false for one-time tasks.
  • Timer values are in seconds: For unit_type: "timer", the target_value and log value are in seconds (e.g. 600 = 10 minutes).