---
title: "Upsert Game"
method: POST
path: "/api/v1/games"
tags: ["Games"]
---

# Upsert Game

`POST /api/v1/games`

Upsert a game record.

Inserts a new game or updates an existing one based on video_id.
If game_id is not provided, a UUID will be auto-generated.

## Headers

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

## Request body

- GameUpsertRequest — Request schema for upserting a game record.
  - `game_id` string, uuid, required — Game ID (must be a valid UUID)
  - `home_team_id` string, uuid, required — Home team identifier (must be a valid UUID)
  - `away_team_id` string, uuid, required — Away team identifier (must be a valid UUID)
  - `season` string, required — Season (e.g., '2026')
  - `season_type` string, required — Season type (e.g., 'regular season', 'playoffs')
  - `scheduled_date_time` string, date-time, required — Scheduled game date and time (must include timezone, e.g., '2026-02-01T19:00:00+11:00' for Australia/Melbourne)
  - `venue` string, nullable — Game venue
  - `game_status` string, required — Game status (e.g., 'scheduled', 'in progress', 'completed')

## Response `200`

Successful Response

- GameUpsertResponse — Response schema for game upsert operation.
  - `success` boolean, required — Whether the operation was successful
  - `message` string, required — Status message
  - `video_id` string, required — The internal identifier of the created game record

## 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/42cb7b14430f/schema)
