For the complete documentation index, see llms.txt. This page is also available as Markdown.

Water logs

Record an end user's water intake and read it back as daily totals.

Each operation acts on one end user (End-user identity). Client-token scopes: water_logs:write to create or delete; water_logs:read to list.

Units and limits

Send each amount as { "value": …, "unit": … } in one of these units:

Unit
Accepted value per log

fl_oz

1–811.5

ml

30–24,000

cup (US cup, 8 fl oz)

0.1–101.4

  • The minimums don't convert exactly into one another (1 fl oz is about 29.6 ml, below the 30 ml minimum), so send the unit the user entered.

  • An end user's total is capped at 24 L (about 811 fl oz) per UTC calendar day of created_at, whatever offset you send. A log that would pass the cap fails with 400 daily_water_limit_exceeded.

  • created_at is when the water was consumed (Days and timezones). Omit it to log the water now.

  • A created log comes back in the unit it was sent in. Save its id to delete it later.

  • The list returns one total per local calendar day between start_date and end_date (both inclusive, in timezone), oldest first, in the unit you ask for (required), rounded to one decimal place. Days with nothing logged are absent, and an empty list is a valid result.

  • The list returns at most 100 days; when more match, you get the most recent 100, so move end_date back to read older days. start_date can be at most five years before today in timezone; an earlier date fails with 400 date_range_too_large.

  • Creating a log is not idempotent. Before you retry a create that timed out, list the day to check whether it was recorded, because a retry records the water twice and counts it twice toward the cap.

  • Deleting is idempotent: an unknown or already-deleted log also returns 204. A deleted amount no longer counts toward its day's cap.

Log water for a user

post

API key or client token.

Records one amount of water, in fl_oz, ml or cup (1–811.5 fl_oz, 30–24000 ml, 0.1–101.4 cup). An end user's total is capped at 24 L (about 811 fl oz) per day: a log that would take the day of its created_at past it is refused with daily_water_limit_exceeded. Save the returned id to delete the log. Not idempotent: verify with the list endpoint before retrying a timed-out create, since a retry records the water twice and counts twice toward the cap.

Callable with a client token carrying the water_logs:write scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Body
created_atstring · date-timeOptional

When the water was consumed — any ISO-8601 offset; stored and returned in UTC with milliseconds. Omitted = now. Its day is the one the daily cap counts it against.

Example: 2026-09-10T07:30:00-07:00
Responses
201

The logged entry: its id, the amount in the unit it was sent in, and created_at in UTC.

application/json
idstringRequired

Save this id to delete the log.

Example: 78129823-8ba2-4183-b13b-71f0e963c606
created_atstring · date-timeRequired

When the water was consumed. UTC, with milliseconds.

Example: 2026-09-10T14:30:00.000Z
post/v1.2/water-logs
POST /v1.2/water-logs HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 78

{
  "amount": {
    "value": 8,
    "unit": "fl_oz"
  },
  "created_at": "2026-09-10T07:30:00-07:00"
}
{
  "id": "78129823-8ba2-4183-b13b-71f0e963c606",
  "amount": {
    "value": 8,
    "unit": "fl_oz"
  },
  "created_at": "2026-09-10T14:30:00.000Z"
}

List a user's daily water totals in a date range

get

API key or client token.

Returns one total per local calendar day between start_date and end_date (both inclusive, in timezone), oldest first, in the unit you ask for, rounded to one decimal place. Days with nothing logged are absent. At most 100 days are returned — when more match, the most recent 100. start_date may reach back at most 5 years from today in timezone. An empty list is a valid result.

Callable with a client token carrying the water_logs:read scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Query parameters
start_datestring · dateRequired

First local calendar date in timezone, inclusive. May be at most 5 years before today in timezone.

Example: 2026-09-01
end_datestring · dateRequired

Last local calendar date in timezone, inclusive. May equal start_date for a single day. When more than 100 days in the range have water logged, the most recent 100 are returned.

Example: 2026-09-10
timezonestringRequired

IANA timezone that defines the local calendar days this range covers. Required: without it the days would be cut in UTC, which silently shifts anything logged near midnight into the wrong day for anyone not on UTC.

Example: America/Los_Angeles
unitstring · enumRequired

The unit every daily total is returned in.

Example: fl_ozPossible values:
Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Responses
200

One total per local day with water logged, oldest first; an empty array is a valid result.

application/json
get/v1.2/water-logs
GET /v1.2/water-logs?start_date=2026-09-01&end_date=2026-09-10&timezone=America%2FLos_Angeles&unit=fl_oz HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "date": "2026-09-10",
      "total": {
        "value": 64,
        "unit": "fl_oz"
      }
    }
  ]
}

Delete a water log

delete

API key or client token.

Idempotent: deleting an unknown or already-deleted log answers the same 204, so it is safe to retry. The amount no longer counts toward its day's cap.

Callable with a client token carrying the water_logs:write scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Path parameters
log_idstringRequired

The log id returned when the log was created.

Example: 78129823-8ba2-4183-b13b-71f0e963c606Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Responses
204

The log was deleted; empty body. Idempotent — deleting an already-deleted or unknown log also answers 204.

No content

delete/v1.2/water-logs/{log_id}
DELETE /v1.2/water-logs/{log_id} HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated

Was this helpful?