---
title: "Auto-generate this week's plan for workspaces due right now"
method: POST
path: "/api/v1/jobs/plan-week"
tags: ["jobs"]
---

# Auto-generate this week's plan for workspaces due right now

`POST /api/v1/jobs/plan-week`

## Request

- Base URL: `https://api.cadencz.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.cadencz.com/api/v1/jobs/plan-week`
- Auth: none declared

Cloudflare Cron callback. **Must be scheduled hourly (`0 * * * *`)**, not weekly.

Each workspace picks its own planning weekday, hour, and timezone in its automation settings; this endpoint plans only the workspaces whose configured hour is the current one. An hourly tick is what turns a single global cron into per-workspace scheduling without a job queue — run it weekly and almost every workspace is skipped.

Authenticates with `WORKER_SECRET`. Auto-planning is opt-in per workspace and is idempotent: a workspace that already has a plan for the current week is skipped.

## Response `200`

Successful Response

- PlanWeekJobResponse
  - `status` 'ok', required
  - `workspaces` integer, required
  - `planned` integer, required
  - `skipped` integer, required
  - `failed` integer, required

## Other responses

- `401`: Missing or invalid worker secret.
- `503`: Required infrastructure or provider config is unavailable.

---

[API](https://skmtc.dev/cadencz/apis/cadencz-api.md) · [All operations](https://skmtc.dev/cadencz/apis/cadencz-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cadencz/apis/cadencz-api/revisions/3392fe5e93db?raw)
