Skip to content

Programs: operations and tools

Each tool is called as x.programs.<tool>. Its description is the one a model reads. Input and output are the tool’s schemas.

Give a published program to a person or to a class type from a start date: pins the program’s current published version and makes one dated session per session of its layout (week w’s session on day d is dated start + 7(w-1) + (d-1)). Editing the program later changes none of them; publish a new version and assign again. Refused when the program has never been published. Safe to call again with the same program, person or class type and start date: it finishes what an interrupted call began.

Risk bulk-write
Audiences staff
Field Type Required Limits Description
programId string yes min length 1, max length 64
personId string min length 1, max length 64 A person: a client program
classTypeId string min length 1, max length 64 A class type: a class program
startDate string yes pattern ^\d{4}-\d{2}-\d{2}$
Field Type Required Limits Description
assignmentId string yes
programVersion number yes
sessions number yes
startDate string yes
endDate string yes

A person’s own sessions on a date (default today, UTC: pass the person’s local date), each with its plan (blocks, items, levels and typed targets), the bank exercises it uses and the numbers of the last time they did each. A member sees their own; staff name the person. A class type’s sessions are programs.classToday. Read-only.

Risk read
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
date string pattern ^\d{4}-\d{2}-\d{2}$
personId string min length 1, max length 64 Staff: the person. A member is always themselves.
Field Type Required Limits Description
date string yes
sessions array of object yes
sessions[].id string yes
sessions[].name string or null yes
sessions[].date string or null yes
sessions[].week number or null yes
sessions[].day number or null yes
sessions[].kind string or null yes
sessions[].classType string or null yes
sessions[].assignment string or null yes
sessions[].programVersion number or null yes
sessions[].programTitle string or null yes
sessions[].classTypeName string or null yes
sessions[].focus string or null yes
sessions[].state string or null yes
sessions[].plan map of any or null yes The session of the layout: blocks, items, levels and typed sets
sessions[].exercises array of object yes
sessions[].exercises[].id string yes
sessions[].exercises[].name string or null yes
sessions[].exercises[].video string or null yes
sessions[].exercises[].cues string or null yes
sessions[].exercises[].measure string or null yes
sessions[].exercises[].last array of object yes The sets of the last time this person did it, before this session
sessions[].exercises[].last[].date string or null yes
sessions[].exercises[].last[].reps number or null yes
sessions[].exercises[].last[].seconds number or null yes
sessions[].exercises[].last[].load number or null yes
sessions[].exercises[].last[].rpe number or null yes
sessions[].exercises[].last[].level number or null yes

One session: its plan, the bank exercises it uses with the person’s last numbers at each, and the sets logged on it so far. A member reads their own sessions and their class types’ (where personId is never given); staff read any, and name the person for a class session’s logs. Read-only.

Risk read
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
sessionId string yes min length 1, max length 64
personId string min length 1, max length 64 Staff: the person. A member is always themselves.
Field Type Required Limits Description
session object yes
session.id string yes
session.name string or null yes
session.date string or null yes
session.week number or null yes
session.day number or null yes
session.kind string or null yes
session.classType string or null yes
session.assignment string or null yes
session.programVersion number or null yes
session.programTitle string or null yes
session.classTypeName string or null yes
session.focus string or null yes
session.state string or null yes
session.plan map of any or null yes The session of the layout: blocks, items, levels and typed sets
exercises array of object yes
exercises[].id string yes
exercises[].name string or null yes
exercises[].video string or null yes
exercises[].cues string or null yes
exercises[].measure string or null yes
exercises[].last array of object yes The sets of the last time this person did it, before this session
exercises[].last[].date string or null yes
exercises[].last[].reps number or null yes
exercises[].last[].seconds number or null yes
exercises[].last[].load number or null yes
exercises[].last[].rpe number or null yes
exercises[].last[].level number or null yes
logged array of object yes
logged[].id string yes
logged[].item string or null yes
logged[].exercise string or null yes
logged[].setNumber number or null yes
logged[].level number or null yes
logged[].target object yes
logged[].target.reps number or null yes
logged[].target.seconds number or null yes
logged[].target.load number or null yes
logged[].actual object yes
logged[].actual.reps number or null yes
logged[].actual.seconds number or null yes
logged[].actual.load number or null yes
logged[].rpe number or null yes
logged[].note string or null yes
logged[].recordedAs string or null yes
logged[].recordedByName string or null yes
logged[].exerciseName string or null yes The exercise’s name, as it was when logged

A class type’s sessions on a date (default today, UTC), with their plans: every level of every item, typed targets, and the bank exercises. What a coach runs a class from and a member reads before it. Notes for coaches only are left out for members. Read-only.

Risk read
Audiences staff, customer
Field Type Required Limits Description
classTypeId string yes min length 1, max length 64
date string pattern ^\d{4}-\d{2}-\d{2}$
Field Type Required Limits Description
date string yes
sessions array of object yes
sessions[].id string yes
sessions[].name string or null yes
sessions[].date string or null yes
sessions[].week number or null yes
sessions[].day number or null yes
sessions[].kind string or null yes
sessions[].classType string or null yes
sessions[].assignment string or null yes
sessions[].programVersion number or null yes
sessions[].programTitle string or null yes
sessions[].classTypeName string or null yes
sessions[].focus string or null yes
sessions[].state string or null yes
sessions[].plan map of any or null yes The session of the layout: blocks, items, levels and typed sets
sessions[].exercises array of object yes
sessions[].exercises[].id string yes
sessions[].exercises[].name string or null yes
sessions[].exercises[].video string or null yes
sessions[].exercises[].cues string or null yes
sessions[].exercises[].measure string or null yes
sessions[].exercises[].last array of object yes The sets of the last time this person did it, before this session
sessions[].exercises[].last[].date string or null yes
sessions[].exercises[].last[].reps number or null yes
sessions[].exercises[].last[].seconds number or null yes
sessions[].exercises[].last[].load number or null yes
sessions[].exercises[].last[].rpe number or null yes
sessions[].exercises[].last[].level number or null yes

Log one set done on a session: the item (A1), the exercise when the item has more than one, the level taken when it has levels, which set (1, 2, …), what was done (reps, seconds, load) and how hard it felt (RPE). The target is taken from the session’s plan, and who recorded it is the caller. A member logs on their own sessions and their class types’; a coach logs for a client (on a class session, naming them). Nobody logs on a session that is not theirs. A set already logged (a retried save, a second device) is not logged twice: its numbers and effort become these, and its note is kept unless one is given. Returns the set.

Risk write
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
sessionId string yes min length 1, max length 64
item string yes min length 1, max length 6
exerciseId string min length 1, max length 64
level integer ≥ 1, ≤ 5
setNumber integer yes ≥ 1, ≤ 30
actual object yes
actual.reps integer ≥ 0, ≤ 999
actual.seconds integer ≥ 0, ≤ 7200
actual.load number ≥ 0, ≤ 1000 Kilograms
rpe number ≥ 1, ≤ 10 How hard it felt, 1 to 10 in halves
note string max length 500
personId string min length 1, max length 64 Staff: the person. A member is always themselves.
Field Type Required Limits Description
id string yes
item string or null yes
exercise string or null yes
setNumber number or null yes
level number or null yes
target object yes
target.reps number or null yes
target.seconds number or null yes
target.load number or null yes
actual object yes
actual.reps number or null yes
actual.seconds number or null yes
actual.load number or null yes
rpe number or null yes
note string or null yes
recordedAs string or null yes
recordedByName string or null yes
exerciseName string or null yes The exercise’s name, as it was when logged

Take back a set logged by mistake (un-tick it): the set with this number of a session’s item and exercise. A member takes back their own; a coach a client’s (on a class session, naming them). A set that is not logged changes nothing, so a retried call is safe. The row goes to the Trash, where staff can restore it. For staff the Trash is an extension’s delete, so the org’s approval policy may hold it for a person: waiting counts those. Returns how many rows were taken back.

Risk write
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
sessionId string yes min length 1, max length 64
item string yes min length 1, max length 6
exerciseId string yes min length 1, max length 64
setNumber integer yes ≥ 1, ≤ 30
personId string min length 1, max length 64 Staff: the person. A member is always themselves.
Field Type Required Limits Description
removed integer yes ≥ -9007199254740991, ≤ 9007199254740991
waiting integer yes ≥ -9007199254740991, ≤ 9007199254740991 Staff: rows whose removal waits for a person’s approval

Change a logged set’s numbers, effort or note. A member changes their own sets only; staff any. The target, the exercise and who recorded it stay as they were. Returns the set.

Risk write
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
logId string yes min length 1, max length 64
actual object
actual.reps integer ≥ 0, ≤ 999
actual.seconds integer ≥ 0, ≤ 7200
actual.load number ≥ 0, ≤ 1000 Kilograms
rpe number ≥ 1, ≤ 10 How hard it felt, 1 to 10 in halves
note string or null
Field Type Required Limits Description
id string yes
item string or null yes
exercise string or null yes
setNumber number or null yes
level number or null yes
target object yes
target.reps number or null yes
target.seconds number or null yes
target.load number or null yes
actual object yes
actual.reps number or null yes
actual.seconds number or null yes
actual.load number or null yes
rpe number or null yes
note string or null yes
recordedAs string or null yes
recordedByName string or null yes
exerciseName string or null yes The exercise’s name, as it was when logged

Mark one of a person’s sessions done or skipped (or back to planned). A member marks their own; staff any personal session. A class type’s sessions are not marked by members. Made from the session’s current state, so two marks at once count once. Returns the session.

Risk write
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
sessionId string yes min length 1, max length 64
state "done", "skipped", "planned" default "done"
Field Type Required Limits Description
changed boolean yes
session object yes
session.id string yes
session.name string or null yes
session.date string or null yes
session.week number or null yes
session.day number or null yes
session.kind string or null yes
session.classType string or null yes
session.assignment string or null yes
session.programVersion number or null yes
session.programTitle string or null yes
session.classTypeName string or null yes
session.focus string or null yes
session.state string or null yes
session.plan map of any or null yes The session of the layout: blocks, items, levels and typed sets

Every set a person logged of one exercise, oldest first (date, set, level, target and what was done, effort), and their bests at it (heaviest load, most reps, longest time). A member reads their own; staff name the person. At most 2,000 sets; capped says when there were more. Read-only.

Risk read
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
exerciseId string yes min length 1, max length 64
personId string min length 1, max length 64 Staff: the person. A member is always themselves.
from string pattern ^\d{4}-\d{2}-\d{2}$
until string pattern ^\d{4}-\d{2}-\d{2}$
Field Type Required Limits Description
exercise object yes
exercise.id string yes
exercise.name string or null yes
sets array of object yes
sets[].id string yes
sets[].item string or null yes
sets[].exercise string or null yes
sets[].setNumber number or null yes
sets[].level number or null yes
sets[].target object yes
sets[].target.reps number or null yes
sets[].target.seconds number or null yes
sets[].target.load number or null yes
sets[].actual object yes
sets[].actual.reps number or null yes
sets[].actual.seconds number or null yes
sets[].actual.load number or null yes
sets[].rpe number or null yes
sets[].note string or null yes
sets[].recordedAs string or null yes
sets[].recordedByName string or null yes
sets[].exerciseName string or null yes The exercise’s name, as it was when logged
sets[].date string or null yes
best object yes
best.load number or null yes Heaviest load in one set
best.reps number or null yes Most reps in one set
best.seconds number or null yes Longest time in one set
capped boolean yes

A person’s training at a glance: for each exercise they logged, how many sets, the first and last date, and their bests; and for each of their assignments, sessions planned, done and skipped. Optionally only one assignment. A member reads their own; staff name the person. Worked out over at most 2,000 sets (capped). Read-only.

Risk read
Audiences staff, customer
Permission programs:coach
Field Type Required Limits Description
personId string min length 1, max length 64 Staff: the person. A member is always themselves.
assignmentId string min length 1, max length 64
Field Type Required Limits Description
exercises array of object yes
exercises[].id string yes
exercises[].name string or null yes
exercises[].sets number yes
exercises[].first string or null yes
exercises[].last string or null yes
exercises[].best object yes
exercises[].best.load number or null yes Heaviest load in one set
exercises[].best.reps number or null yes Most reps in one set
exercises[].best.seconds number or null yes Longest time in one set
assignments array of object yes
assignments[].id string yes
assignments[].title string or null yes
assignments[].sessions number yes
assignments[].done number yes
assignments[].skipped number yes
assignments[].planned number yes
capped boolean yes

Draft a program from a brief (“12 weeks of handstand strength, 3 sessions a week”) as a working copy for a coach to edit: weeks of sessions of blocks of exercises taken only from the bank, with default sets. The assistant reads the brief with the extract model role when the deployment has AI, and the numbers and words in it otherwise. It never publishes: a person with the publish permission does, after editing. Returns the new program.

Risk write
Audiences staff
Field Type Required Limits Description
brief string yes min length 3, max length 2000
title string min length 1, max length 200
kind "class", "client", "course" default "client"
Field Type Required Limits Description
programId string yes
title string yes
weeks number yes
sessions number yes
published false yes Always false: a person publishes it
exercises array of object yes
exercises[].id string yes
exercises[].name string yes

Turn pasted program shorthand, or a document’s text, into a working copy with structured targets: Title:, Kind:, Guidance:, Week:, Session: (a weekday names its day), Focus:, Warm-up: with - lines, Block A: with its rounds, items A1: with an exercise (for everyone), with level lines 1: to 5: (“+” done together, “|” alternatives), or with both, * notes for coaches and TV: notes shown to members. Exercises are matched to the bank by name. Every line it could not read is listed with why, for the coach to fix; nothing is guessed. With a key (the text’s name in its source), running it again changes the same program: updated while it still holds what the import last wrote, unchanged when the text is the same, and a conflict, left alone, when someone has edited it since. dryRun reads and checks the text and says what would happen, writing nothing. Never publishes. Returns the program and the unread lines.

Risk write
Audiences staff
Field Type Required Limits Description
text string yes min length 1, max length 200000
title string min length 1, max length 200
kind "class", "client", "course" Left out: what a Kind: line says, else class
key string min length 1, max length 200 The text’s import key (its file name in the source): one program per key
dryRun boolean default false Read and check only; write nothing
Field Type Required Limits Description
programId string or null yes Null only for a dry run that would create one
title string yes
weeks number yes
sessions number yes
published false yes Always false: a person publishes it
outcome "created", "updated", "unchanged", "conflict", "invalid" yes
items number yes
unread array of object yes
unread[].line number yes
unread[].text string yes
unread[].reason string yes
faults array of object yes Where the layout breaks the schema (a dry run’s check; a write is refused)
faults[].path string yes
faults[].message string yes

None.

Dashboard Label Widgets
training 8

The operations its code may call through ctx.ops, as its manifest asks for them.

None.

Host modules it asks for: ops, ai.