Sundial Habits
Reference

Set Habit Completion

POST
/api/v1/check-ins

Check or uncheck your habit for an explicit date. May publish a shared check-in and trigger friend notifications under your existing sharing settings. Reuse requestID only for identical retries. Read the latest habit and check-in revisions before changing state.

Authorization

accessKey
headerAuthorizationBearer <Sundial access key>

Request Body

application/json
  1. body
requestID*string
Formatuuid
habitID*string
Formatuuid
day*string

Gregorian calendar date, YYYY-MM-DD, between 1900 and 2100.

Match^\d{4}-\d{2}-\d{2}$
timeZone*string

IANA time zone used to interpret today, such as America/Los_Angeles.

Lengthlength <= 100
completed*boolean
expectedRevision*|

The check-in revision returned by list_habits; null when no record exists.

Match^\d+$
expectedHabitRevision*string

The habit revision returned by list_habits. Changes to the habit or its sharing invalidate it.

Match^\d+$

Response Body

Confirmed result.

application/json
  1. response
requestID*string
Formatuuid
checkIn*
Example Request
curl -X POST 'https://api.sundialhabits.com/api/v1/check-ins' \  -H 'Authorization: Bearer <ACCESS_KEY>' \  -H 'Content-Type: application/json' \  -d '{  "requestID": "00000000-0000-4000-8000-000000000002",  "habitID": "00000000-0000-4000-8000-000000000002",  "day": "2026-10-20",  "timeZone": "America/Los_Angeles",  "completed": true,  "expectedRevision": "1",  "expectedHabitRevision": "1"}'
Example Response
{  "requestID": "00000000-0000-4000-8000-000000000002",  "checkIn": {    "habitID": "00000000-0000-4000-8000-000000000002",    "day": "2026-10-20",    "completed": true,    "timeZone": "America/Los_Angeles",    "revision": "1"  }}