---
title: "Log a workout"
method: POST
path: "/api/workout"
---

# Log a workout

`POST /api/workout`

## Request

- Base URL: `https://healthpartner.shrynshjn.com`
- URL: `https://healthpartner.shrynshjn.com/api/workout`
- Auth: none declared

Client must send startTime (and endTime if present) with timezone offset.

## Request body

- WorkoutRequest
  - `user_input` string
  - `name` string, required
  - `type` 'yoga' | 'running' | 'walking' | 'cycling' | 'gym', required
  - `startTime` string, date-time, required: ISO 8601 with timezone offset.
  - `duration` number, required: milliseconds
  - `endTime` string, date-time
  - `calories` number
  - `location` 'indoor' | 'outdoor' | 'gym'
  - `description` string
  - `intensity` 'low' | 'medium' | 'high'
  - `avgHeartRate` number
  - `source` string
  - `idempotencyKey` string
  - `media` string[]
  - `naturalText` string

## Response `201`

Created

- WorkoutResponse
  - `message` string
  - `workoutId` string
  - `createdAt` string, date-time

---

[API](https://skmtc.dev/shrynshjn/apis/health-partner-api.md) · [All operations](https://skmtc.dev/shrynshjn/apis/health-partner-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shrynshjn/apis/health-partner-api/revisions/687e966e4267?raw)
