Skip to content
skcal
Esc
↑↓navigate↵open⌘Jpreview

Update goals

Partially updates the caller’s targets; omitted fields are left unchanged.

PUT/api/targets
Authorization
__Secure-better-auth.session_tokenAPI key · cookierequired

Better Auth session. Signing in (Google or email magic link) sets an HttpOnly session cookie that scopes every request to that account. The web app and CLI use this; agents use the OAuth 2.1 flow of the MCP server.

or
AuthorizationBearer token · headerrequired

Personal API key sent as Authorization: Bearer skcal_…. Create and scope keys in the app under your profile → API keys. Keys default to full access; a scoped key is limited to its granted resource:action permissions and cannot manage other keys.

Request body
requiredapplication/json

The fields to change; omitted fields are left unchanged.

goalWeightKgnumber

New target body weight in kilograms.

startWeightKgnumber

New starting body weight in kilograms.

dailyKcalTargetinteger

New daily calorie target.

proteinTargetGinteger

New daily protein target in grams.

targetDateinteger<int64>

New goal date as a Unix epoch in milliseconds.

activitystring

The user's day-to-day activity level in a few words; stored as their single activity-level memory (replacing any previous one).

max length 200
reasonstring

Optional context for why the targets changed; not stored.

max length 500
Responses
200

The targets were updated.

okbooleanrequired

Always true.

Try it
Server
Authorization
Bodyapplication/json
Request
curl -X PUT 'https://app.skcal.fit/api/targets' \
  -H 'Cookie: __Secure-better-auth.session_token=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "goalWeightKg": 70,
  "startWeightKg": 78.4,
  "dailyKcalTarget": 2100,
  "proteinTargetG": 170,
  "targetDate": 1790000000000,
  "activity": "desk job, mostly sitting",
  "reason": "less active after a job change"
}'
Response
{
  "ok": true
}

Was this page helpful?