Marvin Help

Marvin API endpoints

Use Marvin's API to access data that doesn't live in your user database, or for simplicity's sake. We will be adding more endpoints soon.

Basic structure

Marvin's API involves GET and POST requests to https://serv.amazingmarvin.com/api/:endpoint. POST bodies and most responses are encoded as JSON.

Credentials

Include an HTTP header X-API-Token using the API_TOKEN found here if the endpoint requires limited access, or the header X-Full-Access-Token using the FULL_ACCESS_TOKEN also found here if the endpoint requires full access. The idea behind this system is that you might want to give Zapier the ability to create tasks, but not to read your data. If there's user demand then we'll make a proper OAuth system with permissions.

Rotation

Accidentally exposed an API_TOKEN? You can rotate your credentials in the API settings in Marvin (Features page → API).

Endpoints

Test credentials

stable

You can test whether your credentials are correct with a POST:

POST /api/test
X-API-Token: XYZ
=>
"OK"

Create a task

stable, but new document's _id and _rev will be included in the response in the future

You can quickly create a task with a POST request:

Note: send actual JSON. The following has inline documentation.

POST /api/addTask
X-API-Token: XYZ
{
  "done": false,
  "day": "2020-07-17",
  "title": "Work 30m homework #School", // supports some autocompletion (parent, day, dueDate, plannedWeek, plannedMonth, timeEstimate, labels, isStarred). Use header X-Auto-Complete=false to disable autocompletion.
  "parentId": "xyz", // ID of parent category/project
  "labelIds": ["abc", "def"], // IDs of labels
  "firstScheduled": "2020-07-17",
  "rank": 999,
  "dailySection": "Morning",
  "bonusSection": "Essential", // or "Bonus"
  "customSection": "a3gnaiN31mz", // ID of custom section (from profile.strategySettings.customStructure)
  "timeBlockSection": "b00m3feaMbeaz", // ID of time block
  "note": "Problems 1-4",
  "dueDate": "2020-07-20",
  "timeEstimate": 3600000, // ms
  "isReward": false,
  "isStarred": 3,
  "isFrogged": 2,
  "plannedWeek": "2020-07-12",
  "plannedMonth": "2020-07",
  "rewardPoints": 1.25,
  "backburner": true, // Manually put in backburner (can also be backburner from label, start date, etc.)
  "reviewDate": "2020-09-09",
  "timeEstimate": 300000, // duration estimate in ms


  // Time offset in minutes
  //
  // Added to time to fix time zone issues.  So if the user is in Pacific time,
  // this would be -8*60.  If the user added a task with +today at 22:00 local
  // time 2019-12-05, then we want to create the task on 2019-12-05 and not
  // 2019-12-06 (which is the server date).
  "timeZoneOffset": 60,
}

Unless you add an X-Auto-Complete=false header, the title will be processed similar to autocompletion within Marvin. So if you use "Example task +today", then the task will be scheduled for today and " +today" will be removed from the title. If you put "#Category" (or #"Category with spaces") in the title, the server looks it up among your categories and open projects, the same way Marvin does (ID, exact title, then ignoring case, spaces, hyphens, dots and slashes), and files the task there. If no category matches, the text stays in the title and the task goes to the Inbox. Labels written as "@label" or @"label with spaces" are resolved to their IDs when you open Marvin.

See Marvin data types for documentation about how these fields work. Only the above fields are consumed by this API. If you want to set other fields, add directly to the couchdb.

Also accepted and kept as sent: startDate, endDate, permaSnoozeTime ("HH:mm") and noAutoOrbit. Whole numbers can be sent as 1 or 1.0.

Title shortcuts the API understands:

  • #Category or #"Category name": parent category or project

  • ##Goal or ##"Goal name": add to a goal

  • +today, +friday, +2d, +2026-10-30: schedule for a day (sets day, not a deadline)

  • due friday or ]2026-10-30: due date

  • &thisWeek, &nextWeek, &thisMonth, &nextMonth: plan for a week or month

  • ~15, ~30m, ~1.5h: time estimate (minutes if no unit)

  • @label or @"label name": labels

  • Priority: a star followed by p1, p2 or p3 (or 1/2/3, a/b/c), for example *p1. Tasks get isStarred 3/2/1, projects get priority high/mid/low

  • starts 2d or |2d, ends friday or =2026-11-05: start and end date, only when Start Dates / End Dates is turned on

Dates can be yesterday, today, tomorrow, a weekday, a month name (the 1st of that month), in a week, in a month, next year, a number with d/w/m/y (2d, 3w), YYYY-MM-DD, D.M.YYYY or M/D/YYYY. Other quick-add words from the app (the star words such as urgent, fire and lowfocus, and $MONTH) are not read by the API and stay in the title.

Working sample code (just change the API token):

curl -H 'X-API-Token: test' -XPOST -d '{"title": "Example API task +today"}' https://serv.amazingmarvin.com/api/addTask 

Mark a task done

experimental

You can mark a task done by POSTing its ID to /api/markDone.

POST /api/markDone
X-API-Token: XYZ
{
  "itemId": "x23n123nk",
  "timeZoneOffset": 60
}

Your timezone offset, in minutes, should be included in order to correctly determine the date when the task was marked done.

Only tasks can be marked done this way: a project gets 400 "Can only mark Tasks done with this API" (use /api/doc/update for projects). An unscheduled task is moved to the day it was completed. A task that already has a day keeps it, so /api/doneItems lists it under that day, not the completion day. If you want it under the completion day, also set day with /api/doc/update. An ID that doesn't exist gets 404.

Many things happen in the Marvin client when you mark a task done. Some of these are implemented, and more will be implemented in the future. If a feature is missing that affects your workflow, please create an issue.

  • Handle pinned tasks

  • Stop tracking time

  • Repeat after X days (echo)

  • Repeat after X days - subtasks

  • Repeat after X days - due date

  • Repeat after X days - end date

  • Repeat after X days - plannedWeek/plannedMonth

  • Repeat after X days - limit to weekdays

  • Give reward points

  • Attached rewards

  • Kudos

  • Update "worked on at"

Won't be implemented:

Create a project

stable

You can quickly create a project with a POST request:

Note: send actual JSON. The following has inline documentation.

POST /api/addProject
X-API-Token: XYZ
{
  "done": false,
  "day": "2020-07-17",
  "title": "Work 30m homework #School", // supports some autocompletion (parent, dueDate, labels)
  "parentId": "xyz", // ID of parent category/project
  "labelIds": ["abc", "def"], // IDs of labels
  "firstScheduled": "2020-07-17",
  "rank": 999,
  "dailySection": "Morning",
  "bonusSection": "Essential", // or "Bonus"
  "customSection": "a3gnaiN31mz", // ID of custom section (from profile.strategySettings.customStructure)
  "timeBlockSection": "b00m3feaMbeaz", // ID of time block
  "note": "Problems 1-4",
  "dueDate": "2020-07-20",
  "timeEstimate": 3600000, // ms
  "isReward": false,
  "priority": "high", // "high", "mid", or "low"
  "isFrogged": 2,
  "plannedWeek": "2020-07-12",
  "plannedMonth": "2020-07",
  "rewardPoints": 1.25,
  "rewardId": "anbeN3mRneam", // Unique ID of attached Reward
  "backburner": true, // Manually put in backburner (can also be backburner from label, start date, etc.)
  "reviewDate": "2020-09-09",
  "timeEstimate": 300000, // duration estimate in ms
  "itemSnoozeTime": 1599577206923, // Date.now() until when it's snoozed
  "permaSnoozeTime": "09:00",

  // Time offset in minutes
  //
  // Added to time to fix time zone issues.  So if the user is in Pacific time,
  // this would be -8*60.  If the user added a task with +today at 22:00 local
  // time 2019-12-05, then we want to create the task on 2019-12-05 and not
  // 2019-12-06 (which is the server date).
  "timeZoneOffset": 60,
}

If not scheduled, use day=null.

color, icon and labelIds sent with the request are kept. Projects store P1/P2/P3 in priority ("high" = P1, "mid" = P2, "low" = P3; a project's "low" is not Low priority). isStarred is ignored by this endpoint; to give a project Low priority, set isStarred to -1 afterwards with /api/doc/update. The title shortcuts are the same as for /api/addTask (see the list above, except ##Goal).

Create an event

experimental

You can quickly create an event with a POST request:

Note: send actual JSON. The following has inline documentation.

Note: calendar sync happens on the client. You must have Marvin running on one of your devices in order for this event to be calendar synced!

POST /api/addEvent
X-API-Token: XYZ
{
  "title": "Haircut",
  "note": "Problems 1-4", // Use markdown
  "length": 3600000, // ms
  "start": "2021-08-21T14:30:00.000Z", // ISO formatted start time
}

Read any doc

stable

With the fullAccessToken you can GET any individual document in the couchdb database by ID.

Bug fix / breaking change: in the past this API only worked when reading ProfileItems since it returned the val field directly. Now the entire document is returned, even when db="ProfileItems".

If there is no document with that ID (or it was deleted), the response is still 200, with a body like {"error": "not_found", "reason": "missing"} or "reason": "deleted". Check for the error field.

GET /api/doc?id=strategySettings.labelSettings.groups
X-Full-Access-Token: ABC
=>
{
   "_id" : "strategySettings.labelSettings.groups",
   "_rev" : "12-8dcc836705e9f1ae98f1525092b82b31",
   "createdAt" : 1564154150216,
   "db" : "ProfileItems",
   "fieldUpdates" : {
      "createdAt" : 1568180186429,
      "db" : 1568180586429,
      "updatedAt" : 1568180536429,
      "val" : 1582132559581
   },
   "updatedAt" : 1582132559548,
   "val" : {
      "84fYiqsxgZadr" : {
         "_id" : "81fYbqsxGZadr",
         "createdAt" : 1564159272192,
         "icon" : "cxicons8-circled-7",
         "isExclusive" : false,
         "isMenu" : true,
         "rank" : 4,
         "title" : "numbers"
      }
   }
}

Update any doc

experimental

With the fullAccessToken you can update any doc. It is recommended that you update fieldUpdates.FIELD in order to get functioning conflict resolution and updatedAt for correct display within Marvin.

Be careful with this API! Updating a document, especially a setting, and giving it the wrong shape might cause Marvin to crash on startup. You can probably remedy this with /api/doc/delete or by sending another /api/doc/update with the correct value, but it won't always be obvious to find out what went wrong. You may have to contact support in order to get a working Marvin again. Read the Marvin data types documentation carefully to avoid creating invalid documents.

This endpoint writes values exactly as you send them. It doesn't check dates, numbers, types, whether a parentId or labelIds exist, whether two labels from an exclusive label group are set together, or whether a field belongs on that kind of item (for example dueDate or priority on a category, which Marvin then shows but doesn't let you remove). Getting these right is up to you. Items whose parent doesn't exist are moved to the Inbox when Marvin opens.

Setting day on a task or project that was never scheduled also sets firstScheduled, like Marvin does (unless you set firstScheduled yourself). A document that doesn't exist or was deleted gets 404 "Item not found". Whole numbers can be sent as 1 or 1.0. Very rarely a request fails with 500 for a moment; the write is all or nothing, so it's safe to retry.

POST /api/doc/update
X-Full-Access-Token: ABC
{
  "itemId": "xy12n3i123",
  "setters": [
    { "key": "done", "val": true },
    { "key": "fieldUpdates.done", "val": 1648122403647 },
    { "key": "updatedAt", "val": 1648122403647 }
  ]
}
=>
{
  "_id": "xy12n3i123",
  "_rev": "2-xyz",
  "done": true,
  "fieldUpdates": {
    "done": 1648122403647
  },
  "updatedAt": 1648122403647,
  "title": "Example task",
  ...
}

Create any doc

experimental

With the fullAccessToken you can create any doc. It is recommended that you include createdAt for correct display within Marvin.

Be careful with this API! Creating a document, especially a setting, and giving it the wrong shape might cause Marvin to crash on startup. You can probably remedy this with /api/doc/delete or by sending a /api/doc/update with the correct value, but it won't always be obvious to find out what went wrong. You may have to contact support in order to get a working Marvin again. Read the Marvin data types documentation carefully to avoid creating invalid documents.

If you leave out _id, the database picks one and the response includes it, so you can refer to the document afterwards. Like /api/doc/update, values are stored exactly as sent.

POST /api/doc/create
X-Full-Access-Token: ABC
{
  "_id": "xy12n3i123",
  "db": "Tasks",
  "title": "Example task",
  "done": false,
  "createdAt": 1649150426400
}
=>
{
  "_id": "xy12n3i123",
  "_rev": "1-xyz",
  "title": "Example task",
  "done": false,
  "createdAt": 1649150426400
}

Delete any doc

experimental

With the fullAccessToken you can delete any doc.

Be careful with this API! Marvin's Trash functionality is client-side only, so you won't be able to recover any documents deleted in this way (unless you implement your own trash functionality). Deleting a document shouldn't cause Marvin to crash on startup.

There is no way to send an item to the Trash through the API. The Trash is a copy kept only on the device that deleted the item. Don't try to imitate it by setting deletedAt with /api/doc/update: the item will not appear in the Trash and will stay in your lists, but some features will start ignoring it. If you want deletes you can undo, read the item with /api/doc and keep a copy before deleting it.

A document that doesn't exist or is already deleted gets 404 "Item not found".

POST /api/doc/delete
X-Full-Access-Token: ABC
{
  "itemId": "xy12n3i123"
}

Get the currently tracked task

stable, but will be extended to include how long tracked

GET /api/trackedItem
X-API-Token: XYZ
=>
{
  "_id": "a12345",
  "db": "Tasks",
  "title": "Work 30m on homework"
}

GET /api/currentItem is an alias for the same endpoint.

Get child tasks/projects of a category/project

experimental

Marvin has infinite nesting of tasks/projects with categories/projects. The ID of an item's parent is stored in its parentId field. You can use the /api/children endpoint to query the children of a category/project. This returns all items that have parentId equal to the ID you provide. You will have to do additional queries if you want to retrieve the nested grandchildren, and further descendants. Note: this endpoint previously returned done items but now only returns open items. Please get in touch if you need an endpoint that includes done items.

GET /api/children?parentId=unassigned
X-API-Token: XYZ
X-Parent-Id: unassigned // optional, can be used instead of query parameter
=>
[...]

The response is an array of Projects and Tasks.

Get tasks and projects scheduled today (including rollover/auto-schedule due items if enabled)

stable, but improvements coming

GET /api/todayItems
X-API-Token: XYZ
=>
[...]

Time zone issues are possible here (the server is UTC+0), so it's best to provide a date. This can either be done using a query parameter or the X-Date header. In both cases, use the date format "YYYY-MM-DD".

This endpoint, like /api/dueItems, only filters by date (day, and dueDate when auto-schedule is on). It doesn't hide items the app hides from your Today list: items on the backburner, items with a start date in the future, items waiting on a dependency, or items whose parent no longer exists. An item can also have both a day and a plannedWeek. Apply those rules yourself if you want the same list as the app.

GET /api/todayItems?date=2021-11-15
X-API-Token: XYZ
=>
[...]

OR

GET /api/todayItems
X-API-Token: XYZ
X-Date: 2021-11-15
=>
[...]

Get tasks and projects completed today

experimental

Returns the tasks and projects that were completed on a day. Like todayItems, you can pass the date as a query parameter or with the X-Date header. Without a date, the server's date (UTC) is used. Items are matched by their day, not by when they were completed (doneAt). Marvin moves a task to the day you complete it, but /api/markDone only does that for unscheduled tasks, so a task completed through the API stays under the day it was scheduled for.

GET /api/doneItems?date=2021-11-15
X-API-Token: XYZ
=>
[...]

Get open Tasks and Projects that are due today (or earlier)

stable, but improvements coming

GET /api/dueItems
X-API-Token: XYZ
=>
[...]

You can also choose a date other than today by setting the by query param. This is a good idea in any case since you may or may not be in the same time zone as the server.

GET /api/dueItems?by=2022-09-11
X-API-Token: XYZ
=>
[...]

Get a list of today's time blocks

experimental

GET /api/todayTimeBlocks?date=2023-02-28
X-API-Token: XYZ
X-Date: 2023-02-28 // Can be sent instead of query parameter
=>
[...]

The response is an array of Time Blocks.

Get a list of all categories

stable

You can access a list of all your categories with a GET request. See Categories for documentation of the data format.

GET /api/categories
X-API-Token: XYZ
=>
[{ "_id": "a4123412", "title": "Work", "parentId": "root", "color": "#4184a0", ... }, ...]

Get a list of all labels

stable

Get a list of all labels, in their sort order (used in sort by label).

GET /api/labels
X-API-Token: XYZ
=>
[{ "_id": "abcdefg1234", "title": "quick", "color": "#f0a0a0", "icon": "tag", "groupId": "5421fabcdae" }, ...]

The label groups can be found by reading the sync database document profile.strategySettings.labelSettings.groups.

See documentation for labels and label groups

Start/stop time tracking

You can use the /api/track endpoint to start or stop time tracking a task by its ID

POST /api/track
POST /api/time # alias you can use if "track" is in a browser extension blacklist
X-API-TOKEN: XYZ
{
 taskId: "abc",
 action: "START"
}
=>
{
 startId: "abc",
 startTimes: [1595791080814],
 stopId: "xyz", // or null
 stopTimes: [1595791066096, 1595791080814],
 issues: ["Wanted to..."],
}

Valid actions are "START" and "STOP".

NOTE: you are responsible for updating the stopped task's duration and times! Otherwise Marvin's UI will be missing data in some places. How to update? Updating documents

See Marvin data types for documentation about duration and times.

See Marvin data types for more documentation about how time tracking times are stored.

Getting time track info

Marvin caches time track data in task.times and task.duration. But if you use the API to do time tracking and don't update the task, or if something went wrong with sync, then this info might be missing. You can get the source of truth about time track data using the /api/tracks endpoint.

You can request the time track data for up to 100 tasks at once. This API will then return an array of time track data with taskId and a times array. See Marvin data types for documentation about times.

POST /api/tracks
POST /api/times # alias you can use if "track" is in a browser extension blacklist
X-API-TOKEN: XYZ
{
  "taskIds": ["nfieamewpemnfiqe"],
}
=>
[
  { "taskId": "nfieamewpemnfiqe", "times": [1625985037144, 1625985043470, 1625985049000, 1625985054374] }
]

Instead of task IDs, you can ask for everything tracked on a day by sending a date and your time zone offset in minutes (timeZone, for example -120 for GMT+2 or 420 for GMT-7). Up to 100 tasks are returned.

POST /api/tracks
X-API-TOKEN: XYZ
{
  "date": "2026-10-04",
  "timeZone": -120
}
=>
[ { "taskId": "...", "times": [...] }, ... ]

Claiming reward points

Completed a task or celebrating something? Claim some reward points.

Good to know: points must be more than 0 (negative points get 400). Points claimed with itemId "MANUAL" aren't stored per item, so they can't be unclaimed (/api/unclaimRewardPoints answers 404 "No such entry"). To take manual points back, spend them. Spending more points than you have gets 400 "Not enough reward points".

POST /api/claimRewardPoints
X-API-TOKEN: XYZ
{
  "points": 1.5,
  "itemId": "an2m1n213ml", // Task ID or "MANUAL" for manual point reward
  "date": "2020-09-08", // Used to track points today
  "op": "CLAIM",
}
=> user profile

Unclaiming reward points

User error? Task marked incomplete? Unclaim the reward points.

POST /api/unclaimRewardPoints
X-API-TOKEN: XYZ
{
  "itemId": "an2m1n213ml", // Which itemId to undo (determines how many points)
  "date": "2020-09-08", // Used to track points today
  "op": "UNCLAIM",
}
=> user profile

Spending reward points

POST /api/spendRewardPoints
X-API-TOKEN: XYZ
{
  "points": 2.5,
  "date": "2020-09-08", // Used to track points spent today
  "op": "SPEND",
}
=> user profile

Reset reward points

Permanently deletes earn/spend history and resets reward points to 0.

POST /api/resetRewardPoints
X-FULL-ACCESS-TOKEN: XYZ
=> user profile

Get Marvin Kudos info

GET /api/kudos
X-API-TOKEN: XYZ
=>
{
  "kudos": 0,
  "level": 1,
  "kudosRemaining": 350
}

Me

Retrieve some information about your account.

GET /api/me
X-API-Token: XYZ
=>
{
  "email": "test@amazingmarvin.com",
  ...
}

See Marvin Data Types for documentation on which fields are available and what they mean.

Notebooks

With the Notebooks feature, a project or category can have several notes (pages), organized into sections. These are stored in their own documents: a notebook (db Notebooks, with parentId set to the project or category, or null for a standalone notebook) and its pages (db Pages, with notebookId, sectionId, rank, title and note).

Once a project's note has moved into a notebook, the API still shows it as the project's note: responses that return a project or category include the text of its first page, plus notebookId and notePageId. Updating a project's note with /api/doc/update writes to that first page.

Get a notebook with all its pages

experimental

GET /api/notebook?parentId=<project or category id>
GET /api/notebook?id=<notebook id>
X-Full-Access-Token: XYZ
=>
{ "notebook": {...} or null, "pages": [ {...page, including its note}, ... ] }

List all notebooks

experimental

Returns every notebook, attached and standalone, with its pages' titles but not their text. Get a page's text with /api/doc?id=<page id> or a whole notebook with /api/notebook.

GET /api/notebooks
X-Full-Access-Token: XYZ
=>
[ { ...notebook, "pages": [ {...page without its note}, ... ] }, ... ]

Attachments

Files attached to a task or project (with the Attachments feature) are listed on the item itself, with one attach_<uid> field per file:

"attach_1790792803637_22896": {
  "createdAt": 1790792803637,
  "itemId": "dw6Th8SBwKyBB6ne8G8M",
  "uid": "1790792803637_22896",
  "fileName": "report.pdf",
  "size": 22896
}

Download an attachment

experimental

Send the itemId, uid and fileName from that field. The response is a plain-text download link that is valid for at least a day (up to 7 days). Open or fetch the link with a normal GET; it doesn't need a token.

POST /api/downloadAttachment
X-Full-Access-Token: ABC
{
"itemId": "dw6Th8SBwKyBB6ne8G8M",
"uid": "1790792803637_22896",
"fileName": "report.pdf"
}
=>
https://s3.eu-central-003.backblazeb2.com/...

Requires the full access token (the limited API token is not accepted) and an active subscription.

Working sample code (just change the token and the three values):

curl -H 'X-Full-Access-Token: test' -XPOST -d '{"itemId": "dw6Th8SBwKyBB6ne8G8M", "uid": "1790792803637_22896", "fileName": "report.pdf"}' https://serv.amazingmarvin.com/api/downloadAttachment

Reminders

Reminders are attached to Tasks for display in Marvin (see documentation for Tasks). But they must also be set on the server in order to get push notification on your mobile device. Use the following Reminder APIs to list, set, and delete Reminders on the server. Note: if you have cloud sync disabled and don't want to share task titles with Marvin's servers, then don't use these APIs! These APIs are not used within Marvin when your cloud sync is disabled in order to avoid leaking Task data.

Get a list of all reminders

Sending a GET to the /api/reminders endpoint will return an array of all reminders that are currently scheduled. See documentation for Reminders.

GET /api/reminders
X-Full-Access-Token: ABC
=>
Reminder[]

Set reminders

You can set one or more reminders using the /api/reminder/set endpoint. POST an array of Reminders to set them. See documentation for Reminders. Reminders are currently only pushed to mobile phones, so make sure that you have installed the Amazing Marvin mobile app and logged in. If the Reminders you create correspond to scheduled tasks, be sure to update the reminder info in the task in order to keep the Marvin user interface accurate.

POST /api/reminder/set
X-API-Token: XYZ
{
  "reminders": [{
    "time": 1678098457794,
    "offset": 5,
    "reminderId": "AA64AC0A-42BD-4EC7-A9F9-8E27BDFA3665",
    "type": "M",
    "title": "Example reminder",
    "snooze": 9,
    "autoSnooze": true,
    "canTrack": false
  }]
}
=>
"OK"
}

Delete one or more Reminders

Be sure to also delete the reminder info in the corresponding Tasks in order to keep the Marvin user interface accurate.

POST /api/reminder/delete
X-API-Token: XYZ
{
  reminderIds: String[], // IDs of Reminders to delete
}
=>
"OK"

Delete all Reminders

Be sure to also delete the reminder info in the corresponding Tasks in order to keep the Marvin user interface accurate.

POST /api/reminder/deleteAll
X-Full-Access-Token: ABC
=>
"OK"

Get Goals

stable

See Goals for documentation of the data format.

GET /api/goals
X-API-Token: XYZ
=>
[{ _id: "123", title: "Example Goal", ... }]

Habits

The /api/updateHabit endpoint is used to record, undo record, and rewrite the history of habits. By default the endpoints only affect the backend database (which is the source of truth). You should either update the Habit stored in cloudant yourself (See Database Access), or set updateDB=true to have the server do it for you.

Record a habit

experimental

POST /api/updateHabit
X-API-Token: XYZ
{
  "habitId": "1n2ifni0qnf31",
  "time": 1678378323530,
  "value": 4
  "updateDB": true
}
=>
New Habit Value

Undo last habit recording

experimental

POST /api/updateHabit
X-API-Token: XYZ
{
  "habitId": "1n2ifni0qnf31",
  "undo": true,
  "updateDB": true
}
=>
New Habit Value

Rewrite habit history

experimental

POST /api/updateHabit
X-API-Token: XYZ
{
  "habitId": "1n2ifni0qnf31",
  "history": [1646092800000, 2, 1678378323530, 4],
  "updateDB": true
}
=>
New Habit Value

Get a Habit

experimental

You can retrieve a Habit, including its full history, using the /api/habit endpoint. This retrieves a Habit.

GET /api/habit?id=abc
X-API-Token: XYZ
=>
{...}

List Habits

experimental

You can retrieve a list of all your Habits, with full history, using the /api/habits endpoint. This retrieves an array of Habits.

GET /api/habits
X-API-Token: XYZ
=>
[...]

If you include ?raw=1, then the entire habit objects will be returned, rather than just history information. You will need to send the full access token in this case.

/api/habit, and /api/habits without ?raw=1, return the server's history record for each habit (habitId and history), not the habit itself: there's no title, and a habit that has never been recorded isn't in the list at all. Use /api/habits?raw=1 when you need titles or every habit. In /api/updateHabit, numbers can be sent as 1 or 1.0, but they must be whole numbers.