Mutations
Write operations. They act on the caller’s own data unless prefixed with admin.
adminAdjustCredit
Section titled “adminAdjustCredit”Add to (or, when negative, take off) one account coach balance, in micro-USD. Audited.
Returns Int! · Access Admins only
| Argument | Type | Description |
|---|---|---|
deltaMicro |
Int! |
Micro-USD to add (negative takes off). |
userId |
ID! |
User. |
adminCreateInvite
Section titled “adminCreateInvite”Create an invite code.
Returns Invite! · Access Admins only
adminRevokeInvite
Section titled “adminRevokeInvite”Revoke an unused invite code.
Returns Boolean! · Access Admins only
| Argument | Type | Description |
|---|---|---|
code |
String! |
Code. |
adminSetUserDisabled
Section titled “adminSetUserDisabled”Disable (sign out and lock out everywhere) or re-enable an account.
Returns Boolean! · Access Admins only
| Argument | Type | Description |
|---|---|---|
disabled |
Boolean! |
Disable or enable. |
reason |
String |
Shown in the audit log. |
userId |
ID! |
User. |
applyAgentProposal
Section titled “applyAgentProposal”Make a change the agent proposed. It runs once; a decided or expired proposal is left as it is.
Returns AgentProposal! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Proposal id. |
archiveFolder
Section titled “archiveFolder”Archive a folder, or restore it (archived: false). Archived, it leaves the Workout screen with its routines; nothing in it changes, and restored it is back where it was.
Returns RoutineFolder! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
archived |
Boolean |
False restores it; true when left out. |
id |
ID! |
Folder id. |
cancelNotifications
Section titled “cancelNotifications”Call off the notifications still waiting (rest skipped, back on screen, workout ended). Returns how many.
Returns Int! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
kinds |
[NotificationKind!] |
Only these kinds; leave out for all. |
cancelRestPush
Section titled “cancelRestPush”Cancel a scheduled rest notification (rest skipped or workout ended).
Returns Boolean! · Access Signed-in user (own data only)
clearDayOverride
Section titled “clearDayOverride”Return a date to the weekly plan.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
date |
Date! |
Date. |
createApiKey
Section titled “createApiKey”Create a personal API key for the GraphQL API. The full key is in the result only; it cannot be shown again. Needs a signed-in session (an API key cannot create keys).
Returns CreatedApiKey! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
CreateApiKeyInput! |
Name, access and expiry. |
createPlanShare
Section titled “createPlanShare”Share the plan by link. The link holds a snapshot (routines, week, custom exercises) and expires after 30 days.
Returns PlanShare! · Access Signed-in user (own data only)
deleteAgentCheckin
Section titled “deleteAgentCheckin”Delete a check-in the user asked for.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Check-in id. |
deleteAgentConversation
Section titled “deleteAgentConversation”Delete a conversation with the agent, its messages and proposals.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Conversation id. |
deleteBodyweight
Section titled “deleteBodyweight”Delete a day’s reading.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
date |
Date! |
Date. |
deleteCustomExercise
Section titled “deleteCustomExercise”Delete a custom exercise: it leaves routines; logged workouts keep their sets and its name.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Exercise id. |
deleteFolder
Section titled “deleteFolder”Delete a folder. Its routines move to My routines unless withRoutines deletes them too.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Folder id. |
withRoutines |
Boolean |
Delete its routines as well. |
deleteRoutine
Section titled “deleteRoutine”Delete a routine. Days planned with it become rest days; logged workouts stay.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Routine id. |
deleteWorkout
Section titled “deleteWorkout”Delete a workout (or discard a running one).
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Workout id. |
deleteWorkouts
Section titled “deleteWorkouts”Delete several workouts at once, with their sets (the way to clear a selection in History). All or nothing: an id that is not the caller’s workout is Not found and nothing is deleted. Returns how many were deleted.
Returns Int! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
ids |
[ID!]! |
Workout ids, at most 500. |
deleteWorkoutsBetween
Section titled “deleteWorkoutsBetween”Delete every finished workout dated from the first date to the last, both included, with its sets: a month, a week, a day, or the whole history. A running workout is never deleted. Returns how many were deleted; there is no undo.
Returns Int! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
from |
Date! |
First day to delete. |
to |
Date! |
Last day to delete. |
discardAgentProposal
Section titled “discardAgentProposal”Turn down a change the agent proposed.
Returns AgentProposal! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Proposal id. |
disconnectApp
Section titled “disconnectApp”End an app’s access now: removes the user’s consent and every token the app holds for them.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
clientId |
ID! |
OAuth client id from connectedApps. |
finishWorkout
Section titled “finishWorkout”Finish a workout: saves it, reports records and what was trained, and records body weight if entered.
Returns FinishResult! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
WorkoutInput! |
The workout, with finishedAt. |
forgetAgentMemory
Section titled “forgetAgentMemory”Make the agent forget one fact.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Memory id. |
forgetAllAgentMemories
Section titled “forgetAllAgentMemories”Make the agent forget everything it remembers.
Returns Boolean! · Access Signed-in user (own data only)
heartbeat
Section titled “heartbeat”Report live workout progress (sent periodically while a workout is on screen).
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
HeartbeatInput! |
Progress. |
importHistory
Section titled “importHistory”Write history imported from another app. Days that already have workouts are skipped, so running it twice never duplicates anything.
Returns ImportResult! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
ImportHistoryInput! |
Parsed history. |
importPlan
Section titled “importPlan”Merge a shared plan file into the user’s plan. Nothing of theirs is overwritten except, optionally, the week schedule.
Returns ImportPlanResult! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
plan |
JSON! |
Plan file contents. |
takeWeek |
Boolean |
Replace Monday–Sunday with the file’s schedule. |
importSharedPlan
Section titled “importSharedPlan”Add a plan shared by link. Returns the number of routines added.
Returns Int! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
takeWeek |
Boolean |
Take the week schedule too. |
token |
String! |
Share token. |
loadStarterPlan
Section titled “loadStarterPlan”Add a ready-made plan. The week schedule is only filled when it is empty.
Returns [Routine!]! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
kind |
StarterKind! |
Which plan. |
logBodyweight
Section titled “logBodyweight”Record body weight for a day (one reading per day; the latest wins).
Returns BodyweightEntry! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
BodyweightInput! |
Reading. |
markNotificationsRead
Section titled “markNotificationsRead”Mark notifications of the notifications screen as read, those ids of theirs or all of them. Returns how many were unread.
Returns Int! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
ids |
[ID!] |
Which ones; leave out for all. |
mergeCustomExercise
Section titled “mergeCustomExercise”Link a custom exercise to the library: workouts, routines and stars move to the library exercise and the custom one is removed. Repairs imports that guessed the wrong muscles.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
customId |
ID! |
Custom exercise id. |
libraryId |
ID! |
Library exercise id. |
moveRoutine
Section titled “moveRoutine”Put a routine in a folder, or in My routines (folderId left out or null).
Returns Routine! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
folderId |
ID |
Folder; null or left out = My routines. |
id |
ID! |
Routine id. |
position |
Int |
Display position among the routines. |
removeCoachPhoto
Section titled “removeCoachPhoto”Remove the photo of your own coach.
Returns Settings! · Access Signed-in user (own data only)
removeCustomExercisePhoto
Section titled “removeCustomExercisePhoto”Remove the photo of one of your custom exercises.
Returns CustomExercise! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
exerciseId |
ID! |
Custom exercise id. |
reorderFolders
Section titled “reorderFolders”Set folder display order.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
ids |
[ID!]! |
Folder ids in order. |
reorderRoutines
Section titled “reorderRoutines”Set routine display order.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
ids |
[ID!]! |
Routine ids in order. |
rescheduleDay
Section titled “rescheduleDay”Move a day’s session to another date; the original date becomes a rest day.
Returns [PlanOverride!]! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
from |
Date! |
Date to move from. |
to |
Date! |
Date to move to. |
resetData
Section titled “resetData”Delete all training data (plan, workouts, weigh-ins, settings). The account stays.
Returns Boolean! · Access Signed-in user (own data only)
restoreBackup
Section titled “restoreBackup”Replace all of the user’s data with a backup made by viewer.backup.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
backup |
JSON! |
Backup contents. |
revokeApiKey
Section titled “revokeApiKey”Revoke a personal API key; requests with it fail from now on. Needs a signed-in session.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Key id from apiKeys. |
revokeSession
Section titled “revokeSession”Sign a browser or CLI out of the account. Needs a signed-in session.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Session id from viewer.sessions. |
saveCustomExercise
Section titled “saveCustomExercise”Create or edit a custom exercise.
Returns CustomExercise! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
CustomExerciseInput! |
The exercise. |
saveFolder
Section titled “saveFolder”Create a folder, or rename one. A new folder goes last unless a position is given.
Returns RoutineFolder! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
id |
ID! |
Client id. |
name |
String! |
Name. |
position |
Int |
Display position. |
saveProgram
Section titled “saveProgram”Save a ready-made program: a new folder, last, with a copy of its routines. The weekly schedule stays as it is.
Returns RoutineFolder! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
folderName |
String |
The folder’s name, in the user’s language; the program’s English name if left out. |
kind |
StarterKind! |
Which program. |
saveRoutine
Section titled “saveRoutine”Create or replace a routine.
Returns Routine! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
RoutineInput! |
The routine. |
position |
Int |
Display position. |
saveTemplateRoutine
Section titled “saveTemplateRoutine”Save a copy of one of Explore’s routines (a program’s or a template’s) as the user’s own.
Returns Routine! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
folderId |
ID |
Folder to put it in; My routines if left out. |
id |
ID! |
Its id: program: |
saveWorkout
Section titled “saveWorkout”Save a workout in progress (or edit a finished one). Idempotent by id, so an offline queue can replay it.
Returns Workout! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
WorkoutInput! |
The workout. |
scheduleNotifications
Section titled “scheduleNotifications”Make notifications for moments a few seconds ahead (a hold or a rest running out) so they arrive even with the app closed. Each replaces the ones of its kind still waiting. Returns how many were made: 0 when push is not set up or no browser is registered.
Returns Int! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
notifications |
[NotificationInput!]! |
What to send and when (at most 4). |
scheduleRestPush
Section titled “scheduleRestPush”Schedule the “rest is over” notification so it arrives even with the app closed. Replaces any earlier one.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
body |
String! |
Notification body (already translated). |
seconds |
Int! |
Seconds from now (1–900). |
title |
String! |
Notification title (already translated). |
sendTestPush
Section titled “sendTestPush”Send a test notification to all of the user’s browsers. Returns how many were delivered.
Returns Int! · Access Signed-in user (own data only)
setAgentCheckin
Section titled “setAgentCheckin”Turn the weekly review or the nudge after a break on or off, or change when it goes out. Nothing goes out from 22:00 to 08:00.
Returns AgentCheckin! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
days |
Int |
nudge: days without a workout, 2–14. |
enabled |
Boolean |
On or off. |
kind |
String! |
weekly or nudge. |
time |
String |
weekly: HH:MM, local. |
weekday |
Int |
weekly: Monday = 0 … Sunday = 6. |
setCoachPhoto
Section titled “setCoachPhoto”Set the photo of your own coach: a JPEG or WebP up to 1 MB, base64-encoded. Location, camera and other metadata are removed before it is stored. Make the coach (a name) first.
Returns Settings! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
image |
String! |
The image file, base64 (no data: prefix). |
setCustomExercisePhoto
Section titled “setCustomExercisePhoto”Set the photo of one of your custom exercises: a JPEG or WebP up to 1 MB, base64-encoded. Location, camera and other metadata are removed before it is stored.
Returns CustomExercise! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
exerciseId |
ID! |
Custom exercise id. |
image |
String! |
The image file, base64 (no data: prefix). |
setDayOverride
Section titled “setDayOverride”Change one date without touching the weekly plan (null routine = rest).
Returns PlanOverride! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
date |
Date! |
Date. |
routineId |
ID |
Routine; omit for rest. |
setExerciseSetting
Section titled “setExerciseSetting”Set per-exercise settings (step, added load, rep ceiling, working weight…).
Returns ExerciseSetting! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
ExerciseSettingInput! |
Settings. |
setFavourite
Section titled “setFavourite”Star or unstar an exercise; favourites sort first in the library and the picker.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
exerciseId |
ID! |
Exercise. |
favourite |
Boolean! |
Starred. |
setPassword
Section titled “setPassword”Add a password to this account so it can also sign in with its email and password. Only when the instance allows password sign-in, for accounts that have none yet and are not guests; to change an existing password use the auth API (/api/auth/change-password). Needs a signed-in session.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
password |
String! |
New password, 8–128 characters. |
setWeekday
Section titled “setWeekday”Plan a routine on a weekday (null = rest).
Returns [WeekDay!]! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
routineId |
ID |
Routine; omit for a rest day. |
weekday |
Int! |
Monday = 0 … Sunday = 6. |
subscribePush
Section titled “subscribePush”Register this browser for push notifications.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
PushSubscriptionInput! |
Subscription. |
trackEvents
Section titled “trackEvents”Report what the app saw the person do that the server cannot (a screen opened, the app opened, a workout started): up to 20 events, each a name from a fixed list and a few small facts. Returns how many were kept: none when the browser asks not to be tracked, when the instance keeps no events, or when the person has reached the most a day holds.
Returns Int! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
events |
[TrackedEventInput!]! |
The events, oldest first. |
unsubscribePush
Section titled “unsubscribePush”Unregister a browser.
Returns Boolean! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
endpoint |
String! |
Subscription endpoint. |
updateSettings
Section titled “updateSettings”Change preferences.
Returns Settings! · Access Signed-in user (own data only)
| Argument | Type | Description |
|---|---|---|
input |
SettingsInput! |
Fields to change. |