---
title: "Ingest Historical Stats"
method: POST
path: "/api/v1/biomech/historical-stats"
tags: ["Biomech"]
---

# Ingest Historical Stats

`POST /api/v1/biomech/historical-stats`

Ingest biomech historical stat rows.

Player resolution: if a row uses ``player.alias`` for a pitcher that does not
yet exist in ``player_info``, this endpoint will bootstrap the row with
``team_id=NULL`` (no team binding is available at this stage). Callers should
establish ``player_info`` first — either via ``POST /biomech/sessions`` (which
can resolve ``team_id`` from the session's ``team_id`` field) or by pre-creating
rosters — to avoid teamless pitcher records.

## Headers

- `x-api-key` string, nullable
- `League` string, nullable

## Request body

- BiomechHistoricalStatsRequest
  - `stats` BiomechHistoricalStat[], required
    - `player` PlayerRef, required — Reference a player either by canonical player_id or pitchbio alias.
      - `player_id` string, nullable — Canonical player_id
      - `alias` string, nullable — Pitchbio player alias, for example pitcher_001
    - `stage` 'fp' | 'mer' | 'br', required
    - `metric` 'shoulder_abduction' | 'shoulder_horizontal_abduction' | 'shoulder_external_rotation' | 'elbow_flexion' | 'left_hip_flexion' | 'right_hip_flexion' | 'left_knee_flexion' | 'right_knee_flexion' | 'stride_length' | 'pelvis_rotation' | 'torso_rotation' | 'hip_shoulder_separation' | 'elbow_varus_torque' | 'trunk_anterior_tilt' | 'trunk_lateral_tilt', required
    - `value` number, required
    - `captured_at` string, date-time, nullable
    - `pitch_id` string, nullable

## Response `200`

Successful Response

- BiomechHistoricalStatsResponse
  - `success` boolean, required
  - `rows_upserted` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/preciser/apis/preciser-data-management-api.md) · [All operations](https://skmtc.net/preciser/apis/preciser-data-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/preciser/preciser-data-management-api/versions/c5f6b8674011/schema)
