user-states

Assembly of the rolling plan view.

Returns past boards (up to 6 days), today's board, and intents for future days (up to 6 days). If no WeeklyPlan exists for the user, creates a trigger="pending" placeholder and enqueues a background generation — the response comes back immediately with plan_trigger="pending" so the client can poll until the real plan is ready. A second week view while pending does not re-enqueue: the placeholder short-circuits the current_plan is None check. The board build does, since the empty placeholder reads as lapsed there; the lock in evaluate_and_update_plan keeps the pair to one generation (#3027). The local plan lifecycle remains for athletes without a stored plan. Athletes with one read its mapped projection and never create a placeholder or tail roll.

get/user_states/week

Request

  • Base URL
    https://api.imperfect.co (the document declares no server; this is the origin it was published from)
  • URL
    https://api.imperfect.co/user_states/week
  • Auth
    HTTP bearer

Query parameters

timezonestring nullable
now_isostring nullable
user_idstring nullable

Headers

accept-languagestring nullable
x-device-timezonestring nullable
x-unitsstring nullable
x-units-sourcestring nullable

Response

Successful Response

goal_nudgestring nullable
plan_generated_atstring required

ISO timestamp of the current plan write.

plan_triggerstring required

Plan write lane or weekly plan lifecycle trigger.

phasestring nullable required

Legacy training phase; null for a stored plan.

Changes