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.
| Field | Type | Req | Description |
|---|---|---|---|
| _temp_id | string | Yes | Unique ID within this file. Used by other entities to reference this activity. |
| type | string | Yes | "habit" or "task" |
| name | string | Yes | Display name |
| status | string | Yes | "active", "archived", or "paused" |
| unit_type | string | Yes | "boolean", "numeric", "timer", or "checklist" |
| start_date | string | Yes | Start date in YYYY-MM-DD format |
| is_recurring | boolean | Yes | Whether the activity repeats |
| description | string | No | Optional description |
| icon | string | No | Icon name (e.g. "water-outline") |
| color | string | No | Hex color (e.g. "#3B82F6") |
| priority | number | No | Priority level (default: 1) |
| target_value | number | No | Goal target (e.g. 8 for 8 glasses) |
| unit_label | string | No | Unit label (e.g. "glasses", "km", "pages") |
| checklist_json | string | No | JSON string of checklist item labels, e.g. '["Milk","Bread"]' (for unit_type: "checklist") |
| goal_direction | string | No | "at_least" (default) or "at_most" |
| start_time_period | string | No | "morning", "afternoon", "evening", or "night" |
| start_time | string | No | Specific time in HH:MM format |
| end_condition_type | string | No | "infinite" (default), "fixed_date", or "repetition_count" |
| end_date | string | No | End date in YYYY-MM-DD format (when end_condition_type is "fixed_date") |
| end_repetition_count | number | No | Number of repetitions (when end_condition_type is "repetition_count") |
tags (optional)
Tags for categorizing activities.
| Field | Type | Req | Description |
|---|---|---|---|
| _temp_id | string | Yes | Unique ID within this file |
| name | string | Yes | Tag name |
| color | string | No | Hex color |
| icon | string | No | Icon name |
activity_logs (optional)
Historical completion/tracking data.
| Field | Type | Req | Description |
|---|---|---|---|
| _temp_activity_id | string | Yes | References an activity's _temp_id |
| start_date | string | Yes | Date in YYYY-MM-DD format |
| status | string | Yes | "COMPLETED", "SKIPPED", "FAILED", "IN_PROGRESS", or "PENDING" |
| start_time | string | No | Time in HH:MM format |
| end_date | string | No | End date for timer activities |
| end_time | string | No | End time for timer activities |
| value | number | No | Numeric value (e.g. glasses of water, seconds for timer) |
| checklist_json | string | No | JSON string of checklist state |
| note | string | No | User note for this entry |
recurrence_rules (optional)
Schedule patterns for recurring activities.
| Field | Type | Req | Description |
|---|---|---|---|
| _temp_activity_id | string | Yes | References an activity's _temp_id |
| rule_type | string | Yes | "one_time", "fixed_schedule", "interval", or "frequency" |
| is_rollover | boolean | No | Whether incomplete items roll over (default: false) |
| value_json | string | Yes | JSON string with schedule details (see examples below) |
activity_tags (optional)
Links between activities and tags.
| Field | Type | Req | Description |
|---|---|---|---|
| _temp_activity_id | string | Yes | References an activity's _temp_id |
| _temp_tag_id | string | Yes | References a tag's _temp_id |
reminders (optional)
Reminder settings for activities.
| Field | Type | Req | Description |
|---|---|---|---|
| _temp_activity_id | string | Yes | References an activity's _temp_id |
| trigger_type | string | Yes | "time_fixed", "time_relative", or "location" |
| fixed_time | string | No | Time in HH:MM format (for "time_fixed") |
| is_enabled | boolean | No | Whether 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
| Field | Valid Values |
|---|---|
| Activity type | habit, task |
| Activity status | active, archived, paused |
| unit_type | boolean, numeric, timer, checklist |
| goal_direction | at_least, at_most |
| end_condition_type | infinite, fixed_date, repetition_count |
| Log status | COMPLETED, SKIPPED, FAILED, IN_PROGRESS, PENDING |
| rule_type | one_time, fixed_schedule, interval, frequency |
| Reminder trigger_type | time_fixed, time_relative, location |
Tips & Common Mistakes
- Log status is UPPERCASE: Use
COMPLETED, notcompleted. All other enum values are lowercase. - Dates must be YYYY-MM-DD:
2025-03-15is valid.March 15, 2025or15/03/2025will be rejected. - Times must be HH:MM:
08:00is valid.8:00 AMwill be rejected. _temp_idmust 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_jsonis a string: The recurrence rulevalue_jsonmust be a JSON string, not a nested object. Use"{\"period\":\"day\"}", not{"period": "day"}.is_recurringdetermines scheduling: Set totruefor repeating habits/tasks. Set tofalsefor one-time tasks.- Timer values are in seconds: For
unit_type: "timer", thetarget_valueand logvalueare in seconds (e.g.600= 10 minutes).