Mutations
Write operations. They act on the caller’s own data unless prefixed with admin.
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. |
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)
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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)
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. |
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. |