add_or_update_event
Create or update planned workouts, races, and events on the Intervals.icu calendar; validate structured workouts and update fields via event_id before writing.
Instructions
Use only when the athlete asks to put a planned workout, race or other event on the calendar or to change one. Writes to Intervals.icu.
Without event_id a new event is created (name required, date default today, category WORKOUT; a duplicate of that day is refused: allow_duplicate); with event_id only the passed fields change, a new date keeps the time of day. workout_doc REPLACES the planned workout and is validated like validate_workout: with errors nothing is written. Text-only sessions (strength, yoga) go into description; text never silently replaces a structured workout (replace_workout). dry_run shows the exact request; the answer reads back what Intervals.icu stored and parsed. Read intervals://workout-syntax (get_guide) before writing steps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Event name; required when creating | |
| indoor | No | Indoor/trainer session; omit to leave unchanged | |
| dry_run | No | true = check and return the exact request, write nothing | |
| category | No | Event category; WORKOUT when creating, unchanged when updating | |
| distance | No | Planned distance in metres (>= 0) | |
| event_id | No | Event to update; omit to create a new event | |
| athlete_id | No | Default: the configured athlete | |
| start_date | No | Day YYYY-MM-DD; default today when creating, unchanged when updating | |
| description | No | Text instead of workout_doc: an exercise list or native Intervals.icu workout text, sent as-is; replaces the text | |
| moving_time | No | Planned moving time in seconds (>= 0) | |
| workout_doc | No | Structured workout (steps); REPLACES the planned workout. Format: intervals://workout-syntax | |
| workout_type | No | Sport, e.g. Ride, Run, Swim, Walk, Row, WeightTraining; needed for a new workout or race unless the name names exactly one sport | |
| allow_duplicate | No | Create even if that day has the same event (name or workout) | |
| replace_workout | No | Allow text or a workout without timed steps to replace a structured workout |