Shortcuts & API
Anything the app can do, the API can do: habits, groups, check-ins, pauses, stats, settings and the CSV export. Create a personal access token in Settings and send it as Authorization: Bearer nnt_....
List your habits, with the id each check-in URL needs:
curl -sS -H "Authorization: Bearer $TOKEN" \ "https://one-oh-one-five.vercel.app/api/v1/habits"
Tick one off for today:
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \ "https://one-oh-one-five.vercel.app/api/v1/habits/$HABIT_ID/checkins"
The whole API is described in openapi.json (OpenAPI 3.1): every path, body and error. Errors always have the shape { "error": { "code", "message" } }. Lists page with an opaque cursor, and creates accept an Idempotency-Key so a retry never logs twice.
The iOS Shortcut how-to
Log a habit from the home screen, the Action button or Siri with one tap and no typing. Each habit gets its own Shortcut. It sends an empty POST to the habit's check-in endpoint, and the reply carries a sentence to show or speak.
What an empty check-in does depends on the habit type:
| Type | One tap does | The reply says |
|---|---|---|
| Yes / no ("Water before coffee") | marks today done; tapping again changes nothing | Water before coffee: done |
| Count ("Glasses of water") | adds 1 to today | Glasses of water: 4/8 today |
| Times a week ("Gym") | marks today done; tapping again changes nothing | Gym: 2/3 this week |
"Today" is your logical day: your time zone with your day cutoff applied, so a tap at 02:30 with a 03:00 cutoff counts for the evening before.
What you need
- A personal access token. In the app, open Settings, create a token (name it "Shortcuts") and copy it. It starts with
nnt_and is shown once. - The habit's log URL. Settings lists every active habit with its log URL and a copy button. The id in it is also the last part of the habit's address,
/habits/<id>, and theidof each habit inGET /api/v1/habits. - Your app's address, for example
https://your-app.example.com.
Build the Shortcut
In the Shortcuts app, create a new Shortcut with two actions:
- Get Contents of URL
- URL:
https://your-app.example.com/api/v1/habits/<id>/checkins - Method: POST
- Headers: add
Authorizationwith the valueBearer nnt_...(your token, after the wordBearerand a space) - Request Body: leave it empty. No JSON is needed.
- URL:
- Show Result, on the message of the result: add a Get Dictionary Value action for the key
messagebetween the two, then Show Result on that value. (Use Speak Text instead to hear it, for Siri.)
Name the Shortcut after the habit ("Glass of water") and then put it where your thumb is:
- Home screen: share the Shortcut, then Add to Home Screen.
- Action button (iPhone 15 Pro and later): Settings > Action Button > Shortcut, then pick it.
- Siri: say the Shortcut's name ("Hey Siri, glass of water").
The same request with curl
This is exactly what the Shortcut sends. e2e/today.spec.ts runs this command against a test server, so it stays true.
curl -sS -X POST -H "Authorization: Bearer $TOKEN" "$BASE_URL/api/v1/habits/$HABIT_ID/checkins"A reply looks like:
{
"habit_id": "7d1c0a8e-2f55-4b8a-9f4e-1a2b3c4d5e6f",
"day": "2026-09-30",
"type": "count",
"value": 4,
"target": 8,
"done": false,
"week": null,
"message": "Glasses of water: 4/8 today"
}Beyond one tap
The same endpoint takes an optional JSON body for other Shortcuts:
{"value": 0}clears today (undo),{"value": 6}sets a count.{"delta": -1}takes one off a count (never below 0).{"day": "2026-09-29"}logs a day in the last 7 days. Older days and future days are refused with a422.- An
Idempotency-Keyheader makes a retry safe: the same key returns the first result instead of logging twice.
DELETE /api/v1/habits/<id>/checkins (optionally ?day=YYYY-MM-DD) removes a day's check-in. The whole API is described in openapi.json.
If it fails
401: the token is wrong or was revoked. Create a new one in Settings.404: the habit id is wrong, or the habit belongs to another account.422: the body or the day is not allowed; the reply'serror.messagesays why.