# Hevy and the Training Log

VitalTrends stores strength sessions in your Training Log. Hevy is one source that can feed that log.

For the complete workflow across Hevy, manual entry, MacroFactor, AI, exercise cleanup, and analytics, see the [Training data guide](https://vitaltrends.net/docs/training.md).

## What syncs

- Workouts with title, notes, start/end time, duration, and Hevy update time.
- Exercises, exercise template IDs, notes, supersets, and set ordering.
- Sets with type, reps, weight, distance, duration, and RPE.
- Derived volume, set counts, exercise counts, PRs, frequency, and muscle-group rollups.

## Connect

1. Create or copy your Hevy API key from Hevy developer settings.
2. Open VitalTrends Connections -> Hevy.
3. Paste the key and save.

VitalTrends validates the key, encrypts it at rest, subscribes the webhook when available, and starts the initial backfill.

## Sync behavior

The first backfill paginates all Hevy workouts. Later syncs use webhook events and an hourly delta job to pick up updates and deletes. Authentication failures mark the connection as needing reconnection.

## Workouts

Hevy sessions appear in the unified workout feed, the dedicated Hevy page, and the Training Log. For likely duplicates, Hevy strength workouts merge with Apple Health strength workouts within a two-minute start window and compatible duration. The merged session keeps the best available source metadata while still showing up as one workout in the Training Log.

Exercise names in strength workout details and Training Log records open a dedicated history page. Each page combines matching canonical exercise names across sources and shows every session and set, max load, estimated one-rep max, total volume, and progression over time. You can rename an exercise from its history page or use `PATCH /api/v1/training/exercises/rename` with a `workout:write` API key. Reusing an existing exercise name combines both histories into one chart, and the old name remains a personal alias for future imports. The rename applies inside VitalTrends and does not change the exercise name stored by Hevy.

## API and export

- `GET /api/v1/workouts/hevy` returns Hevy workouts with exercises and sets.
- `GET /api/v1/workouts/unified` includes Hevy in the merged cross-source feed.
- Export includes a Hevy CSV with one row per set.

## Webhooks

VitalTrends registers `POST /webhooks/hevy/{secret}` as the callback URL for Hevy workout events. The secret is generated per connection and can be rotated from the Hevy connection page.
