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

Weight logs

Record an end user's body weight and read back one weight per day.

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

Units and limits

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

Unit
Accepted value per log

lb

10–1,000

kg

4.5–453.6

  • A weight is stored and returned in the unit it was sent in.

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

  • Every measurement is kept, but the list shows one weight per local calendar day: the one with the latest created_at. A measurement with a later created_at on the same day replaces what that day shows; a backdated one earlier that day doesn't.

  • The list covers start_date to end_date (both inclusive, in timezone), oldest first. Days without a weight 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. A retried create records the measurement twice, and the list then shows it once.

  • Weight logs have no ID and cannot be updated or deleted. To change what a day shows, log a newer measurement for that day.

Log a weight for a user

post

API key or client token.

Records one weight measurement, in lb (10–1000) or kg (4.5–453.6). Every measurement is kept; listing shows one per local day — the latest by created_at — so logging again later the same day replaces what that day shows. Not idempotent: a retried create records the measurement twice, which listing then shows once.

Callable with a client token carrying the weight_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 weight was measured — any ISO-8601 offset; stored and returned in UTC with milliseconds. Omitted = now.

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

The logged weight, as stored: the unit it was sent in, and created_at in UTC.

application/json
created_atstring · date-timeRequired

When the weight was measured. UTC, with milliseconds.

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

{
  "weight": {
    "value": 150,
    "unit": "lb"
  },
  "created_at": "2026-09-10T07:30:00-07:00"
}
{
  "weight": {
    "value": 150,
    "unit": "lb"
  },
  "created_at": "2026-09-10T14:30:00.000Z"
}

List a user's daily weights in a date range

get

API key or client token.

Returns one weight per day between start_date and end_date (both inclusive local calendar dates in timezone), oldest first. Only days with a logged weight appear; when several were logged on one day, the one with the latest created_at is returned, in the unit it was logged in. 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 weight_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: 2024-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 a weight, the most recent 100 are returned.

Example: 2024-09-08
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
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 weight per day that has one, oldest first; an empty array is a valid result.

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

Last updated

Was this helpful?