# Build your own Jefit MCP Everything an AI agent needs to read and write your JEFIT training data. Paste this page into your assistant and ask it to build you an MCP server or a script. This is the plain-text copy of the guide at https://www.jefit.com/my-jefit/settings/api-tokens/guide. It is for building your own client against the Jefit Open Training API with a personal access token. **The Open Training API is in beta.** It works today and we are still improving it, so the contract may change — we'll update this page before a breaking change lands. **It requires an active Elite subscription.** Every request needs one — reads as well as writes. If your Elite lapses, existing tokens stop working immediately; they are checked on every call, not just when created. ### Help us make it better We'd love to make this feature better for you. Tell us what you built, what worked and what got in your way: - Email [support@jefit.com](mailto:support@jefit.com). If a call failed, include the request and the response, but remove the `Authorization` header first: never share your token. If you already did, revoke it on the [access tokens](https://www.jefit.com/my-jefit/settings/api-tokens) page. - If you are in the Jefit app beta (TestFlight on iOS, the beta track on Google Play), you can also post in the **Beta Feedback** tab on the app's Discover screen. Everyone in the beta can read it, so keep requests and tokens out of it. ## 1. Authentication Create a token on the [access tokens](https://www.jefit.com/my-jefit/settings/api-tokens) page and send it as a bearer token. A token acts only on the account that created it — the owner is resolved server-side, so no endpoint takes a user id from you. ``` curl https://www.jefit.com/api/v2/user/routines \ -H "Authorization: Bearer jfit_pat_..." \ -H "Accept: application/json" ``` Choose `Read-only` or `Read + write` when you create the token. A read-only token gets `403` on any POST, PUT, PATCH or DELETE. ## 2. Read the error code, not the status Three different refusals all return `403`, and each needs a different response from you. The status cannot tell them apart, so branch on the `error` field in the body: ``` { "error": "entitlement_required", "message": "..." } ``` **A `400` comes back in one of two shapes**, depending on the endpoint — the single object above, sometimes with a `param` naming the field, or a plural `errors` array. Handle both, or a validation failure reads as an unknown error: ``` { "error": "destructive_write_refused", "message": "...", "param": "data.log_sets" } { "errors": [ { "error": "invalid_param", "message": "...", "param": "name" } ] } (no body at all) ``` The third case is real and common on the write path — session, log, day and day_exercise validation failures return a bare `400`. Treat an empty `400` as a rejection of the body you just sent. A single error object can also carry a `metadata` object. - `entitlement_required` — the Elite subscription lapsed. Only the user can fix this; say so rather than retrying. - `insufficient_scope` — a read-only token attempted a write. Create a read+write token. - `forbidden_resource` — the token touched another account. This is a bug in your client. - `invalid_token` (with `401`) — invalid, expired or revoked. Create a new token. - `destructive_write_refused` (with `400`) — an edit that would have emptied a session or a log. Send the rows it should end up with, or omit the field to leave them alone. Retrying helps in none of these cases. Surface the distinction to your user — “your subscription lapsed” and “this token is read-only” are very different things to be told. `429` is the one refusal you *should* retry. It carries a `Retry-After` header in seconds — wait that long and try again, and do not retry faster than it says — a `429` on a write is refused before anything is written, so it is always safe to retry. A `5xx` is not a rate limit: retry it at most once, and **never on a `POST`**, where the write may have landed and a retry duplicates it. Writes are capped *per token* at **60 a minute and 2,000 a day**. A normal session is nowhere near that — building a plan is about ten calls, logging a workout five to twenty — so hitting it usually means a loop, not a busy user. Reads have no per-token cap, though the ordinary per-account rate limit still applies. ## 3. Exercise ids — the mistake everyone makes first Exercises live in one global id space. Library exercises are prefixed `d_` and your own custom ones `u_`. Always reference an exercise by the full string id returned as `data.id`, exactly as you received it — the prefix is part of the id, so `d_000000000012` and `u_000000000012` are different exercises. What you send back is the exercise's `id`. For your own custom exercises that is **not** the id that appears on logs and day_exercises — see `Three kinds of id` below before you write any lookup code. ## 4. Record types decide which fields mean anything An exercise carries a record type, and it governs which set fields are real. Send the ones that apply and leave the rest out — a duration drill with a weight is meaningless data in your own history. ``` weight_and_reps weight + reps reps reps only reps_and_duration reps + duration duration duration only cardio duration / distance ``` The same enum has two names depending on what you are holding. An exercise calls it `input_format`; a log calls it `record_type`. The values are identical. Sending `record_type` to `POST /v2/exercises` is not an error — the field is ignored and you silently get the default, `weight_and_reps`. **On the way back, do not trust every set field — read the day_exercise's `applicable_set_fields`.** Stored sets carry a weight and reps whatever the exercise is, because the app defaulted them long before there was a record-type check. A cardio drill genuinely reads back as `8 reps @ 10 lb`. Those values are meaningless for it, and repeating them to your user is the mistake this field exists to prevent. ``` { "exercise_id": 100154, "applicable_set_fields": ["duration"], "sets": [{ "weight_lbs": 10, "reps": 8, "duration": 7200 }] } // -> use duration. weight_lbs and reps are leftovers, not data. ``` The stored values are deliberately left alone rather than nulled, so nothing that already reads them breaks. If `applicable_set_fields` is **absent** we could not resolve the exercise — that is different from an empty list, which means no set field applies. ## 5. There is no name search `/v2/exercises` lists the library and accepts only `select`, `sort`, `ids`, `limit` and `offset`. There is **no name-search parameter**. Anything else is rejected with a `400` naming the parameter, so you will find out immediately rather than receiving an unfiltered list that looks like a search result. Page through the library and match names yourself, cache the ids you care about, or create a custom exercise when nothing fits. **Creating is not idempotent** — two identical POSTs give you two exercises with two different ids. Look the name up in your own custom exercises first (`GET /v2/user/exercises` returns all of them), and never retry a create that may have landed: a duplicate is removable with `DELETE /v2/exercises/{id}`, but the removal is permanent and you have to notice it happened. **A create needs `name` and `body_parts`.** List the main body part first. It must be one of `abs`, `back`, `biceps`, `chest`, `forearms`, `glutes`, `shoulders`, `triceps`, `upper_legs`, `lower_legs` or `cardio`. `other/misc` is not accepted as the main body part. If `body_parts` is missing or its first item is not one of these, the create answers `400` with an `invalid_param` error whose `param` is `data.body_parts`. A missing or blank name gets the same error with `param: data.name`. **Always send `limit`.** There is no default and no maximum — omit it and you get the entire library, media urls included, in one response. That is a large payload to hold in a context window. ## 6. Nested data: select and expand **`GET /v2/routines/{id}` and `GET /v2/user/current-routine` ignore `select` and `expand` entirely.** They run a fixed query and always arrive complete — days, their day_exercises and their sets — for library and user routines alike. Trying to trim one is a no-op, not a syntax error. Every other read honours both. `GET /v2/user/routines` and `GET /v2/days/{id}` default to **id-only stubs** for their nested collections, so ask for what you need: `/v2/days/{id}?expand=day.day_exercise.sets`. `expand` adds nesting, `select` trims, and both take a comma-separated dotted path. ``` GET /api/v2/days/u_000000000045?expand=day.day_exercise.sets GET /api/v2/days/u_000000000045?select=name,day_exercise.id ``` The path is a chain of resource names. Singular and plural both resolve, so `day.day_exercise` and `days.day_exercises` are the same request, and what comes back is always keyed in the plural: `days[].day_exercises[]`. **Name the resource you asked for first, or you lose its own fields.** This holds on every read that honours `expand` — which is all of them except the two fixed-query routine reads above, where the whole table is moot because the parameters are ignored: ``` ?expand=day.day_exercise -> { days: [...] } and NOTHING else ?expand=routine.day.day_exercise -> { id, name, ..., days: [...] } ?expand=routine -> { id, name, ... } with no days ?select=name&expand=day -> { name, days: [...] } ``` The first line is a valid request that returns the collection and nothing else — no id, no name. Add the head resource to the front of the path, or name the fields you want with `select`. The relationships you can walk: a `routine` has `day` and `user`; a `day` has `day_exercise`; a `day_exercise` has `sets` and `interval`. **An unrecognised segment is ignored, not rejected.** A typo returns a `200` with the collection simply absent, which looks exactly like an empty routine. If a collection you expected is missing, suspect the path before you suspect the data. ## 7. The golden path Find or create an exercise, build a routine and a day, attach exercises, then log. **Every write body is wrapped in `data`.** This is the most common way an integration fails, and nothing tells you: a flat body is not rejected. `POST /v2/user/routines` with `{ "name": "Upper/Lower" }` returns `201` and a routine called `New Routine`; the same shape on a day gives you `New Day`; and on `day_exercises` it answers `500`. Wrap the body and all three work. Responses are wrapped the same way. **Send `Content-Type: application/json` on every write.** Three endpoints read the parsed body and answer `500` without the header, even when the body is correct and wrapped: `POST /v2/days/{id}/day_exercises`, `PATCH /v2/days/{id}` and `PATCH /v2/day_exercises/{id}`. Others answer `400` or quietly succeed, so a client that omits it fails in three different ways. ``` # create a custom exercise if the library has nothing suitable # (the field is input_format; record_type here is ignored and you get weight_and_reps) POST /api/v2/exercises { "data": { "name": "Sled Push", "body_parts": ["upper_legs"], "input_format": "duration" } } -> u_... # build the plan POST /api/v2/user/routines { "data": { "name": "Upper/Lower", "days_per_week": 4 } } -> routine id POST /api/v2/routines/{id}/days { "data": { "name": "Upper", "index": 0 } } -> day id POST /api/v2/days/{id}/day_exercises { "data": { "exercise": { "id": "d_000000000002" }, "sets": [{ "type": "default", "weight_lbs": 135, "reps": 8, "rest_time": 90 }] } } # superset two slots - all three rules are in section 8: the leader is the slot that runs first # (lowest index) and points at itself; members have equal set counts; linking does NOT change # rest, so send rest_time on each (0 on all but the last for a straight superset). # URL = global id, superset.id = leader's local_id PATCH /api/v2/day_exercises/{leader id} { "data": { "superset": { "id": "" }, "rest_time": 0 } } # last member: its between-rounds rest - keep its current value unless the user wants another PATCH /api/v2/day_exercises/{follower id} { "data": { "superset": { "id": "" }, "rest_time": 90 } } # log what actually happened: create the session, then attach logs # a personal access token only: an AI app connected through Jefit sign-in gets 403 workout_write_app_only # the day is identified by its LOCAL id here - send numeric_day_id, not the day's "u_..." id POST /api/v2/sessions { "data": { "numeric_day_id": 1749013476, "date": 1789664165 } } -> session id # {id} below is the id the session create returned, not its local_id POST /api/v2/sessions/{id}/logs { "data": { "exercise_id": "d_000000000002", "date": 1789664165, "log_sets": [{ "index": 0, "type": "default", "weight": 135, "reps": 8, "interval": 90 }] } } # read your own data back GET /api/v2/user/routines GET /api/v2/user/current-routine GET /api/v2/user/sessions?startDate=&endDate= # sessions WITH their logs GET /api/v2/user/exercises/{exercise_id}/logs?start_date=&end_date= # one exercise GET /api/v2/logs/{log_id} ``` **New day exercises use your saved defaults for omitted set count, reps, and rest.** Explicit values take precedence, and an explicit `sets` or `number_of_reps` list determines the count. A single `number_of_reps` value sent with a `count` applies to every set. Without saved preferences, the defaults are 3 sets, 8 reps, and 60 seconds. A set added by `PATCH` inherits omitted fields from the last existing set. **`PATCH /v2/day_exercises/{id}` replaces the whole set list.** The array you send is the set count afterwards — a shorter array deletes the surplus. A day exercise keeps at least one set, so `sets: []`, `number_of_reps: []`, and `count: 0` get a `400` that names the problem. Read the day_exercise, change what you mean to change, and send the sets it should end up with. **Growing the list is a single call.** Sets that already exist take the values you send, and a set the `PATCH` adds takes the fields you give it, with any you leave out copied from the last existing set. An empty `{}` leaves an existing set as it is. One `POST` per exercise when adding to a day. To read training history, ask for sessions: `/v2/user/sessions` returns each session with its `logs` already nested. To follow one exercise over months, use `/v2/user/exercises/{exercise_id}/logs` instead. It returns only that exercise's logs, so a long range stays small. Send the exercise's global `id`, also for a custom exercise. `start_date` and `end_date` are Unix seconds and exclusive, and with no `start_date` it returns every log of that exercise. **Writes** are restricted to your own account — the owner comes from the token, and a write against anything you do not own returns `forbidden_resource`. **Reads addressed by id** (a routine, a day, a day_exercise) are not owner-filtered, because routines are shareable; an id you were given resolves. Nothing lets you enumerate another account. ## 8. Supersets need three things right, and two of them have no error A superset that looks correct in the data can still run wrong in the app. All three of these have to hold, and only the first one is the field you would think of. **1. The group.** `superset` takes `{ "id": "" }` — the leader's `local_id`, not its `id` — and **the leader has to point at itself** as well as the followers pointing at it. Read `numeric_superset` back: every member of a group shares it. Sending the number as `numeric_superset` works too. A value that names no exercise in the same day is refused with a `400`, and `0` clears the group. **2. Send `rest_time` on every member — linking does not change it.** This is the one that bites. **Jefit honours the rest on every set literally, including sets inside a chain** — deliberately, because a user is allowed to want a pause mid-superset. So a leader that keeps its ordinary rest, or the saved default a new set is created with, puts that pause *between the paired exercises* while `numeric_superset` still reads perfectly on both. For a straight superset every member but the last gets an explicit `0`; the last member keeps the real rest, which is the rest between rounds. In a three-exercise chain, members one and two get `0` and member three carries the rest. A short pause on the earlier members (10 to 15 seconds to set up the next station) is a valid choice too — use it when the user asks for one, and ask before changing a non-zero value an existing superset already has. **A top-level `rest_time` sets the rest on every set.** `{ "data": { "rest_time": 0 } }` updates the day_exercise and each of its sets. A `rest_time` inside `sets` wins for that one set. **3. Every member needs the same number of sets.** Rounds pair one for one, so a three-set leader against a four-set follower has nothing to pair with in round four and that set simply never runs. **A `warm-up` set counts as a set** here, so one warm-up plus three working sets is a *four*-set member. ``` # leader: rest 0 on every set, and it points at ITSELF # the URL takes the GLOBAL id; "superset" takes that same slot's LOCAL id PATCH /api/v2/day_exercises/u_007894839167 { "data": { "rest_time": 0, "superset": { "id": "u_001776789097" }, "sets": [{ "weight_lbs": 115, "reps": 12, "rest_time": 0 }, { "weight_lbs": 115, "reps": 12, "rest_time": 0 }, { "weight_lbs": 115, "reps": 12, "rest_time": 0 }] } } # follower: same set count, and it carries the between-rounds rest PATCH /api/v2/day_exercises/u_007894839004 { "data": { "rest_time": 90, "superset": { "id": "u_001776789097" }, "sets": [{ "weight_lbs": 25, "reps": 8, "rest_time": 90 }, { "weight_lbs": 25, "reps": 8, "rest_time": 90 }, { "weight_lbs": 25, "reps": 8, "rest_time": 90 }] } } ``` **Order is a separate write.** The group field does not decide who leads — `index` does, and it is its own `PATCH`. If the intended leader is not already first in the day, move it — and **re-send the group tag afterwards so it names the new first member's `local_id`**. A tag that names a member which is no longer first still reads as a group, but the head it points at is not the one that runs first. **So verify a superset with three assertions, never one:** the members share a `numeric_superset`; every non-final member's set rests are the value you meant (`0` unless the user asked for a pause or the superset already had one); the members have equal set counts. A group-only check passes on a superset that does not superset. ## 9. Every endpoint a token can reach This is the whole surface. Anything not listed here is unreachable with a token, whatever else you may find referenced elsewhere. ``` Exercises GET /api/v2/exercises list (send limit!) POST /api/v2/exercises create custom -> u_... GET /api/v2/user/exercises your own custom exercises, all of them GET /api/v2/exercises/{id} DELETE /api/v2/exercises/{id} Routines GET /api/v2/user/routines your own POST /api/v2/user/routines GET /api/v2/user/current-routine PUT /api/v2/user/current-routine { "data": { "routine_id": "u_..." } } -> 204. Your own routines only. The apps see it on their next sync, unless a settings change on the phone syncs first. To or from an Adaptive Plan: Periodization is not changed, and a plan due to be regenerated is not regenerated GET /api/v2/routines POST /api/v2/routines GET /api/v2/routines/{id} PATCH /api/v2/routines/{id} DELETE /api/v2/routines/{id} GET /api/v2/routines/{id}/days POST /api/v2/routines/{id}/days Days and exercises within them GET /api/v2/days/{id} PATCH /api/v2/days/{id} DELETE /api/v2/days/{id} GET /api/v2/days/{id}/day_exercises POST /api/v2/days/{id}/day_exercises GET /api/v2/day_exercises/{id} PATCH /api/v2/day_exercises/{id} linking a superset? send rest_time on every member too, and keep a pause an existing superset already has (section 8) DELETE /api/v2/day_exercises/{id} Sessions and logs (writes: personal access tokens only, not connected AI apps) POST /api/v2/sessions start one POST /api/v2/sessions/{id}/logs attach a log GET /api/v2/user/sessions by date range, logs included GET /api/v2/user/exercises/{id}/logs one exercise's logs, by date range GET /api/v2/user/sessions/{local_id} PUT to replace it DELETE /api/v2/user/sessions/{local_id} GET /api/v2/logs/{log_id} PATCH /api/v2/logs/{log_id} DELETE /api/v2/logs/{log_id} Progress GET /api/v2/progressive-overload/setting periodization_enabled: the app sets weight and reps from the phase GET /api/v2/benchmarks?chart= leaderboard: 1 streak, 3 points, 4 community points ``` Deletes reach your own training content and nothing else. **There is no undo** — no trash and no restore — so confirm with the user before removing anything you did not just create yourself. Deleting a routine takes its days and their exercises with it, and deleting a day takes its exercises. **Success is not one status code.** Routine and day deletes answer `200`; day-exercise, custom-exercise and log deletes answer `204`. Treat any 2xx as success — an agent that tests for `204` will read a deleted routine as a failure and retry a delete that already happened. Your account itself is not deletable with a token, and neither is token management — you cannot mint or revoke a token with a token. ## 10. Three kinds of id Most confusion with this API is an id in the wrong shape. There are three, and they are not interchangeable: ``` id "u_003922327403" global row id, prefixed. What URLs take. local_id "u_000000000006" the same object numbered within YOUR account, prefixed. Small numbers. numeric_local_id 6 local_id unencoded. ``` A library routine has no `local_id` — it is `null` until you copy the routine and get your own. Library days and day_exercises do carry one. The prefix says which table the row lives in: `d_` is ours (the exercise library, the pre-built routines), `u_` is yours. Two rows can share a number and differ only by prefix, so never pass a bare integer where a prefixed id belongs. **Sessions, logs and sets do not follow this.** They carry an integer `local_id`, and that integer is what the URL takes — hence `/v2/user/sessions/{local_id}` with a number, next to `/v2/routines/{id}` with `u_000000000123`. A log additionally carries `session_id` (global) beside `local_session_id` (yours). The two session routes take *different* numbers: `/v2/sessions/{id}/logs` wants the id the create returned, while `/v2/user/sessions/{local_id}` wants the local one. And on a session write, the day is its `numeric_day_id` (the day's local id) — sending the day's `u_` id stores a number nothing matches, so the session links to no day. **Always write a custom exercise by its global `id`, but expect its local id back on some reads.** This is the sharpest edge in the API, so read it twice: ``` the exercise itself id: "u_000023628601" <- fetch AND write with this local_id: "u_000000000001" a log you write exercise_id: "u_000023628601" <- the id GET /v2/logs/{id} exercise_id: "u_000000000001" <- the local_id GET /v2/user/sessions exercise_id: "u_000023628601" <- the id on a day_exercise exercise_id: 1, is_system_exercise: false ``` All of these name the same custom exercise. Feeding the `id` to `/v2/exercises/{id}` works; feeding it the `local_id` returns a different exercise or a `404`. Creating a log or changing its `exercise_id` takes the `id`, and a `u_` id that is not one of your own exercises gets a `404`, the same answer as an id that names nothing. For library (`d_`) exercises the two ids are equal, so code that gets this wrong works fine until a user logs something they made up themselves. **Do not compute the mapping — ask for it.** One call gives you both ids for the whole library plus every custom exercise you own, and you can cache it: ``` GET /api/v2/exercises?select=id,local_id,name&limit=2000 { "id": "u_000023628601", "local_id": "u_000000000001", "name": "Daffy" } { "id": "d_000000000002", "local_id": "d_000000000002", "name": "Bench Press" } ``` Build `local_id` → `id` from that once per session and look up whatever a log or a day_exercise hands you. Never construct an id by padding a number yourself: the width is not part of the contract, and for a day_exercise you would also have to guess the prefix from `is_system_exercise`. ## 11. What comes back Every response is wrapped in `data`, with one exception: `GET /v2/benchmarks` returns its four fields at the top level. Fields are listed here as the API returns them today. An exercise: ``` id, local_id, numeric_local_id, name, description, body_parts[], equipment[], input_format, type, difficulty, mechanics, unilateral, nicknames[], tips, average_time, popularity, double_entered_weight, sys_exercise_map_id, numeric_user_id, user, media { image_urls[], gif_url, long_video_urls[], short_video_urls[], thumbnail_urls[] } ``` `popularity` and `double_entered_weight` come back as strings of digits, not numbers. `equipment_detail[]` is added only when you fetch **your own** `u_` exercise by id; a `d_` exercise never has it, and the list endpoint never has it. The field list is the same for both prefixes, but which fields are `null` flips: a custom exercise has no `type`, `mechanics`, `difficulty`, `tips`, `nicknames` or `popularity`; a library one has no `user` or `numeric_user_id`. A routine, a day, a day_exercise. On the reads that honour `expand`, nesting keys appear only if you asked for them; the two fixed-query routine reads always include them: ``` routine id, local_id, numeric_local_id, public_id, code, name, description, day_indexing_style, focus, difficulty, tags[], elite, supports_autoplay, contains_audio_tip, banner_url, popularity_rating, rating, number_of_ratings, views, downloads, review_status, public, last_updated, body_parts[], equipment_tag, main_body_part, main_equipment, day_count, days_per_week, days[], user day id, local_id, numeric_local_id, name, day_of_week, index, rest_day, estimated_duration, week, sort_order, user_id, day_exercises[] day_exercise id, local_id, numeric_local_id, body_part, rest_time, number_of_reps[], count, index, user_id, is_system_exercise, exercise_id, superset, numeric_superset, interval_time_enabled, interval { time, unit }, sets[] set id, local_id, user_id, day_exercise_id, numeric_day_exercise_id, index, type, weight_lbs, reps, rest_time, duration, is_default ``` **`day_count` and `days_per_week` are the same field, and neither is a count.** Both read one user-declared column that defaults to `0` and is never recomputed when days are added or removed, so a routine with ten days can report `0`. Count `days[]` yourself. **Do not join a set to its day_exercise by `day_exercise_id` — it means a different thing per prefix.** On your own `u_` routine it holds the parent's `local_id`; on a library `d_` routine it holds the parent's `id`. Match on the wrong one and you get nothing, silently. Sets already arrive nested under their day_exercise, so read them there. The same flip applies to a set's `local_id`, `user_id` and `is_default`, which are `null` on library sets. A session, with its logs already nested: ``` { "id": 1, "local_id": 1, "user_id": 123, "date": 1700000000, "edit_time": 1700000000, "day_id": "u_000000000045", "numeric_day_id": 45, "total_time": 3600, "workout_time": 3000, "rest_time": 600, "wasted_time": 0, "exercise_count": 5, "total_weight": 10000, "records_broken": 2, "mode": "traditional", "calories": 0, "avg_heart_rate": null, "unit_system": "imperial", "exertion": null, "logs": [ { "local_id": 1, "exercise_id": "d_000000000002", "session_id": 1, "local_session_id": 1, "date": 1700000000, "day_exercise_id": "u_000000000078", "day_item_id": 78, "record_type": "weight_and_reps", "superset": null, "is_system_exercise": true, "unit_system": "imperial", "cardio_local_id": null, "autoplay_generated": 0, "record": 225.0, "log_sets": [ ... ] } ] } ``` A `log_set` always carries `local_id`, `exercise_log_id`, `index`, `type` (`default`, `drop`, `warm-up` or `failure`) and `date`. The rest depends on the record type, and a field that does not apply is absent rather than zero: ``` weight_and_reps weight, reps, interval reps reps, interval duration duration reps_and_duration reps, duration cardio duration, calories, distance, speed, laps ``` `interval` is rest in seconds and is `null` when it was never recorded. `record` appears on a log only for `weight_and_reps` and `reps`. Note that a set uses `weight_lbs` while a log_set uses `weight` — both pounds. `GET /v2/benchmarks?chart=` returns its own shape, and unwrapped: `has_more`, `in_top_benchmarks`, a `current_benchmark` object and a `benchmarks[]` leaderboard of `user_id, username, primary_value, secondary_value, avatar, rank` — other people, not you. **Three responses carry keys BESIDE `data`, not inside it** — look at the top level or you will conclude they are missing. `GET /v2/routines/{id}` adds `unit_system` (the routine owner's, not yours) and `access.permissions` `{ view, edit }`, which is how you ask whether you may edit a routine before attempting the write. `GET /v2/user/routines` and `GET /v2/routines` add `total_count`. ## 12. Known limits - Progress-index (NSPI) figures are not exposed yet. `/v2/benchmarks` is the social leaderboard, not your progress index. - A log whose custom exercise was later deleted is **omitted** from `/v2/user/sessions` rather than marked. A session can therefore report fewer exercises than it contained. - `weight` is always in pounds, on both read and write, whatever units the account displays. Convert at your edges, not in the payload. - To correct a session you can either overwrite it with `PUT /v2/user/sessions/{local_id}` — note a shorter `logs` array drops the surplus, so the overwrite is itself destructive — or remove it outright with `DELETE /v2/user/sessions/{local_id}`. Deleting a session takes its logs with it and also clears the progressive-overload data derived from those dates. - Deleting a custom exercise silently rewrites history: every past log of it disappears from `/v2/user/sessions` (see above). Removing a duplicate you just created is safe; removing one the user has trained with is not. - Token management itself is not token-reachable: you cannot mint or revoke a token using a token. Use the [access tokens](https://www.jefit.com/my-jefit/settings/api-tokens) page. - A successful delete can still be followed by a `200` read for a short period while caches settle. Do not retry the delete — it worked. - The token-create response echoes the scope it stored, so you can confirm what you made. A `null` scope means full own-account access, not “no access”. ## 13. If you are building an MCP server Tools that map cleanly onto the above: `search_exercises`, `create_custom_exercise`, `create_plan`, `add_day`, `update_day_exercise`, `log_workout`, `get_sessions`, `get_session`, `list_routines`, `get_routine`, `get_current_routine`. Add a `superset_group` tool that takes the slots in the order they run and writes the group, the order, every member's rest and equal set counts in one call, with the pause between members as a parameter defaulting to `0` — two of the three superset requirements fail without an error (section 8). Keep the token in your MCP server's environment, never in a prompt or a tool argument — it is a password to your training account and it is revocable from the tokens page if it leaks.