---
title: "Get Week View"
method: GET
path: "/user_states/week"
tags: ["user-states"]
---

# Get Week View

`GET /user_states/week`

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. Concurrent calls while pending do not re-enqueue: the
placeholder short-circuits the ``current_plan is None`` check. The local
plan lifecycle always runs; a runtime flag may substitute a fully validated
Cheshire weekly view only during response assembly.

## Query parameters

- `latitude` number, nullable
- `longitude` number, nullable
- `timezone` string, nullable
- `now_iso` string, nullable
- `user_id` string, nullable

## Headers

- `accept-language` string, nullable
- `x-device-timezone` string, nullable
- `x-units` string, nullable

## Response `200`

Successful Response

- WeekViewResponse — Rolling board history and future plan intents for the mobile client.
  - `days` union[], required
    - union
      - WeekViewBoardDay — One historical or current day in the rolling week response.
        - `date` string, required
        - `type` 'past' | 'today', required
        - `board` object, nullable, required
      - WeekViewIntentDay — One future intent day in the rolling week response.
        - `date` string, required
        - `type` 'intent', required
        - `intent` object, nullable, required
  - `plan_generated_at` string, required — ISO timestamp from Cheshire when its envelope supplies one; otherwise the active legacy plan timestamp.
  - `plan_trigger` string, required — Legacy plan lifecycle trigger; unchanged by read source.
  - `phase` string, nullable, required — Phase from the selected Cheshire or legacy plan source.
  - `plan_source` 'legacy' | 'cheshire', required — cheshire only when its complete view passed every safety gate; legacy for disabled, shadow, out-of-cohort, or fallback reads.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/imperfect/apis/imperfect-api.md) · [All operations](https://skmtc.dev/imperfect/apis/imperfect-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/imperfect/imperfect-api/revisions/cc2293a44257/schema)
