edit_activity
Correct one completed activity when the recording got it wrong — its MEASURED numbers (jammed GPS, a dropped sensor, a computer left running) or the DAY it was filed on. Four modes, and picking the right one is the whole job:
• extend — part of the session DIDN'T RECORD and the athlete says it was like the rest ('первые полчаса не записались, ехал так же'). Pass the new TOTAL movingTime in seconds. Volume scales, intensity is kept, and the personal bests stand. Pass distance too if they know the real total (their usual loop); otherwise it follows the duration.
• correct — a recorded number is FALSE ('Страва посчитала 42 км, а я пробежал 10'). Pass the corrected absolute values. Correcting the distance REMOVES this session's distance records — they were computed from the wrong track and the true splits can't be recovered — so tell the athlete that before they apply.
• move — the recording's CLOCK was wrong, not its numbers: the device filed the session on the wrong day or hour ('записалась на 22 сентября, а ехал сегодня'). Pass date, and time only if the start time was wrong too. Nothing measured changes and syncs won't move it back; Strava and intervals.icu keep their own date — say so.
• merge — ONE session that arrived as TWO activities (Zwift or a head unit restarted its recording, a watch saved mid-ride): 'объедини эти две'. Pass withId = the other half's id (both from list_activities, same sport, the second starting after the first ends, at most 3 h apart). The earlier one stays and absorbs the later (hidden): volume adds up, NP/IF/TSS recomputed, chart and intervals joined, note/RPE/tags carried. Three or more: merge two, then the result with the next. If the athlete ALSO says a stretch between them was not recorded, merge first, then extend the merged one.
• revert — undo earlier corrections, a move or a merge included, and put the provider's original back ('верни как было'); a merge comes apart again (the last one merged). No values needed.
All values are absolute NEW totals (seconds, metres), never deltas. You do NOT compute the consequences: the server recomputes TSS, IF, work and time-in-zone and the confirmation card shows every before→after. Ask for whatever you're missing rather than guessing a number — and get_activity first, so you are correcting the real values. Once corrected, the session is the athlete's: syncs from Strava/intervals stop overwriting its measured fields, and it counts as corrected in the week, the load history and the Records tab.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| ask | Yes | What the athlete asked for, in THEIR words and language — stored with the edit and shown in the app as the reason this session is marked edited. | |
| date | No | `move`: the real day, YYYY-MM-DD. | |
| mode | Yes | ||
| time | No | `move`: the real start, HH:MM (24h); omit to keep the recorded time. | |
| withId | No | `merge`: the id of the OTHER activity of the same session. | |
| distance | No | New total distance in METRES. | |
| elevation | No | New total elevation gain in metres. | |
| movingTime | No | New TOTAL moving time in seconds (not a delta). | |
| elapsedTime | No | New total elapsed/wall-clock seconds. Usually omit — it follows movingTime. |