Skip to content

Mutations

Write operations. They act on the caller’s own data unless prefixed with admin.

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.

Create an invite code.

Returns Invite! · Access Admins only

Revoke an unused invite code.

Returns Boolean! · Access Admins only

Argument Type Description
code String! Code.

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.

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.

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.

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.

Cancel a scheduled rest notification (rest skipped or workout ended).

Returns Boolean! · Access Signed-in user (own data only)

Return a date to the weekly plan.

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
date Date! Date.

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.

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)

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.

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.

Delete a day’s reading.

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
date Date! Date.

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.

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.

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.

Delete a workout (or discard a running one).

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
id ID! Workout id.

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.

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.

Turn down a change the agent proposed.

Returns AgentProposal! · Access Signed-in user (own data only)

Argument Type Description
id ID! Proposal id.

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.

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.

Make the agent forget one fact.

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
id ID! Memory id.

Make the agent forget everything it remembers.

Returns Boolean! · Access Signed-in user (own data only)

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.

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.

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.

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.

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.

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.

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.

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.

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.

Remove the photo of your own coach.

Returns Settings! · Access Signed-in user (own data only)

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.

Set folder display order.

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
ids [ID!]! Folder ids in order.

Set routine display order.

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
ids [ID!]! Routine ids in order.

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.

Delete all training data (plan, workouts, weigh-ins, settings). The account stays.

Returns Boolean! · Access Signed-in user (own data only)

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.

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.

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.

Create or edit a custom exercise.

Returns CustomExercise! · Access Signed-in user (own data only)

Argument Type Description
input CustomExerciseInput! The exercise.

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.

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.

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.

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:: or template:.

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.

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).

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).

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)

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.

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).

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).

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.

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.

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.

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.

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.

Register this browser for push notifications.

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
input PushSubscriptionInput! Subscription.

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.

Unregister a browser.

Returns Boolean! · Access Signed-in user (own data only)

Argument Type Description
endpoint String! Subscription endpoint.

Change preferences.

Returns Settings! · Access Signed-in user (own data only)

Argument Type Description
input SettingsInput! Fields to change.