Baseball Bat Sessions

Ingest Bat Sessions

Changed on

Create or update baseball batting sessions.

Send one or more hitter sessions with swing-level bat-tracking measurements. Stable source identifiers make retries idempotent: a sourceSessionId keeps the gameId assigned by its first upload. Set dryRun to validate and preview the import without database writes.

post/api/v1/baseball/bat-sessions

Request

  • Base URL
    https://developer.preciser.io
  • URL
    https://developer.preciser.io/api/v1/baseball/bat-sessions
  • Auth
    none declared. Required headers: x-api-key, League

Headers

x-api-keystring required

Required API key issued by Preciser.

Leaguestring required

Required tenant/database selector, for example pitchbio-master.

Request body

seasonstring nullable

Optional season label. When omitted, each session uses the year from scheduledAt or sessionDate, so one request may span calendar years.

seasonTypestring

Season type.

gameTierstring

Competition tier.

venuestring

Venue or source label.

speedUnit'kph' | 'mph'

Input unit used by batSpeed and exitVelocity. Defaults to kph, meaning kilometres per hour (km/h). Preciser tracking responses are also returned in km/h.

distanceUnit'm' | 'ft'

Unit used by hitDistance. Values are stored as feet.

syncMode'snapshot' | 'upsert'

snapshot treats every submitted session as its complete current state and removes previously stored swings that are omitted. upsert keeps omitted swings.

dryRunboolean

Validate and prepare the import without writing to the database.

Response

Successful Response

successboolean required
dryRunboolean required
warningsstring[]

Changes

    • breaking

      the header request parameter League became required

    • breaking

      the header request parameter x-api-key became required

    • breaking

      header request parameter League list-of-types was narrowed by removing types null

    • breaking

      header request parameter x-api-key list-of-types was narrowed by removing types null

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property

    • info

      for the header request parameter League, the type was generalized from no type to string

    • info

      for the header request parameter x-api-key, the type was generalized from no type to string

    • info

      the request property became optional

    • info

      the request property default value changed from mph to kph

    • info

      request property list-of-types was widened by adding types null to media type application/json

    • info

      the request property's minLength was decreased from 1 to 0

    • info

      endpoint added