Routines of a shared project API
OpenSpec routines-shared; guide: routines.md.
Implementation notes
OpenSpec routines-shared; guide: routines.md. The rule field project_id (null for a personal routine) makes a routine its project's: once the project is shared it lives in the project's scope like a task and syncs to every member. Owners, admins and editors write it; a viewer's operations are refused (forbidden, with the winning value back), and changing project_id across scopes is refused (scope_change). A shared project holds at most 50 routines; the per-account limit of 50 counts personal routines only (409 limit_reached). A create or patch is refused with 400 invalid_input (*a shared routine acts only in its project: …*) when the trigger, condition or steps name another project, a task of another project or a move out of the project, and when they use labels or a webhook. Steps unavailable in a shared routine carry the reason not_in_shared (Favourite, Set today's focus, the timers, Tracked time, Create and Update project, a project from a template, Create labels, Email me, Send a webhook). The representation of a shared routine carries run_as ({id, name}: the author of the winning enabled: true, null before anyone turned it on) and, when someone else's edit paused it, paused_by; GET /api/v1/me/rules gives both per rule. Its event, schedule, due and overdue runs see only the project, act as run_as (role checked before each run and at writing, device rule:<rule-id>), fire on any member's changes to the project's tasks, and pause with paused_reason edited_by_other (someone else changed trigger, condition, steps, actions, ai_apply or ai_budget), run_as_viewer or run_as_left (the owner, admins and editors get a routine_paused_shared notification, {ruleId, ruleName, projectId, projectName, runAsName, reason, at}). POST …/run (also with test) runs as the caller and answers a viewer 403 forbidden; the draft test takes project_id to plan inside a project. Every member reads the runs (project_id on each run; a non-member gets 404 not_found); POST …/undo needs editor or above (403 forbidden). ai_mode.reason is not_run_as when Apply without asking was turned on by someone other than run_as.
GET /api/v1/routine-emails/{token}
Get a routine email · No authentication
{routine, stopped}: the routine's name and whether the member already stopped its emails; nothing else about the routine
No authentication.
| Field | Type | Description |
|---|---|---|
token required | string | path |
| Field | Type | Description |
|---|---|---|
routine required | string | |
stopped required | boolean |
POST /api/v1/routine-emails/{token}/stop
Routine email stop · No authentication
→ {routine, stopped: true}: the member gets no more emails from the routine; repeating it changes nothing. Audited as settings.changed (routine_email, on → off) of the member
No authentication.
| Field | Type | Description |
|---|---|---|
token required | string | path |
| Field | Type | Description |
|---|---|---|
routine required | string | |
stopped required | boolean |