> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uplift.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Game

> Changes a game's details, teams or periods. Send only the fields to change.

> [!WARNING]
>
> The Game Data API is in preview. Endpoints, fields and limits may change before release, and it is not yet available to call.

Send only the fields to change: the game's `name`, `activity` and `pitch`, its `game_date`, `timezone` and kickoff, its `periods`, or its teams (`roster`, or `home_team` and `away_team`). Any other field returns `400`. The response returns the game's details as they are after the change.

### Date, kickoff and time zone

These follow the same rules as on [Create Game](https://docs.uplift.ai/api-reference/game-data/games/create.md#date-kickoff-and-time-zone), checked against the values in the same request or, where it doesn't send them, the game's own. `"kickoff_at": null` clears the kickoff. A `kickoff_at` without a `game_date` moves the game's date to its own. A change that leaves the kickoff disagreeing with the date or time zone returns `400`.

### Activity and pitch

A new `activity` without a `pitch` takes that activity's default pitch. Neither can change once the game has videos (`409`).

### Roster and teams

A roster sets or replaces the game's roster, and its team names and kit colors become the game's; `"roster": null` removes it. A game with a roster takes its teams from it alone: sending `home_team` or `away_team` for it returns `409`, so replace or remove the roster instead. The roster and teams follow the same rules as on [Create Game](https://docs.uplift.ai/api-reference/game-data/games/create.md#teams-a-roster-or-kit-colors).

### Periods

`periods` replaces the game's whole list; `[]` clears it.

### When a game can't be changed

Nothing about a game can change while one of its videos is reserved, uploading or being processed: those requests return `409` until every video's status is `completed` or `error`, or, for a video that is never uploaded, until 1 hour after it was reserved ([While videos are uploading or processing](https://docs.uplift.ai/api-reference/game-data/videos/create.md#while-videos-are-uploading-or-processing)). Runs that have already started keep the roster, kit colors and periods they started with.


## OpenAPI

````yaml api-reference/game-data/openapi.json PUT /games/{game_id}
openapi: 3.0.0
info:
  title: Uplift Game Data API (Preview)
  version: v1
  description: >-
    Events, phases, possessions, physical summaries and tracking from match
    video. In preview: not yet available.
servers:
  - url: https://api.uplift.ai/v1
security: []
paths:
  /games/{game_id}:
    put:
      tags:
        - Games
      summary: Update Game
      description: >-
        Changes a game's details, teams or periods. Send only the fields to
        change.
      parameters:
        - name: game_id
          in: path
          required: true
          description: Game identifier. The game must belong to your organization.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GameUpdate'
            example:
              game_date: '2026-10-25'
              kickoff_at: '2026-10-25T15:00:00-05:00'
              periods:
                - period: 1
                  label: first_half
                  start_time: 4
                  end_time: 2760
                - period: 2
                  label: second_half
                  start_time: 3660
                  end_time: null
      responses:
        '200':
          description: >-
            The game's details, teams, periods and, when one was sent, its
            roster.
          content:
            application/json:
              schema:
                type: object
                properties:
                  game_id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  activity:
                    type: string
                  updated_at:
                    type: string
                    format: date-time
                  roster_updated_at:
                    type: string
                    format: date-time
                    nullable: true
                  game_date:
                    type: string
                    format: date
                    nullable: true
                  timezone:
                    type: string
                    nullable: true
                  kickoff_at:
                    type: string
                    format: date-time
                    nullable: true
                  pitch:
                    type: object
                    properties:
                      length_m:
                        type: number
                      width_m:
                        type: number
                  home_team:
                    $ref: '#/components/schemas/Team'
                  away_team:
                    $ref: '#/components/schemas/Team'
                  periods:
                    type: array
                    items:
                      $ref: '#/components/schemas/Period'
                  roster:
                    type: array
                    nullable: true
                    items:
                      $ref: '#/components/schemas/RosterPlayer'
                    description: >-
                      The roster sent, as Get Game returns it; `null` when none
                      was sent.
              example:
                game_id: 6b1e0c2a-7d8f-4a51-9b0e-2f3c1d4e5a6b
                name: Uplift Home v Uplift Away
                activity: soccer
                updated_at: '2026-10-19T09:12:40.502Z'
                roster_updated_at: null
                game_date: '2026-10-25'
                timezone: America/Chicago
                kickoff_at: '2026-10-25T15:00:00-05:00'
                pitch:
                  length_m: 105
                  width_m: 68
                home_team:
                  team_side: home
                  name: Uplift Home
                  kit_color: '#ECE83A'
                  goalkeeper_kit_color: '#1F8A3B'
                away_team:
                  team_side: away
                  name: Uplift Away
                  kit_color: '#1B2A4A'
                  goalkeeper_kit_color: '#3A8FE0'
                periods:
                  - period: 1
                    label: first_half
                    start_time: 4
                    end_time: 2760
                  - period: 2
                    label: second_half
                    start_time: 3660
                    end_time: null
                roster: null
        '400':
          description: >-
            Invalid request. A roster that fails its checks also returns
            `problems`, one per issue, naming the row.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: BadRequest
                message: The roster is not valid.
                problems:
                  - 'line 2: position "G" must be written GK'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: NotFound
                message: The specified game_id was not found.
        '409':
          description: >-
            One of the game's videos is uploading or being processed; the game
            has a roster and `home_team` or `away_team` was sent; or the
            activity or pitch was changed on a game with videos.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Conflict
                message: >-
                  This game has a video that is still uploading or being
                  processed. The game, its roster and its videos can be changed
                  once every video is ready or has failed.
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    GameUpdate:
      type: object
      description: At least one field.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        activity:
          type: string
          enum:
            - soccer
          description: >-
            Can't change once the game has videos. A new activity without a
            `pitch` takes its default pitch.
        pitch:
          type: object
          required:
            - length_m
            - width_m
          description: >-
            Length 90–120 m, width 45–90 m. Can't change once the game has
            videos.
          properties:
            length_m:
              type: number
            width_m:
              type: number
        game_date:
          type: string
          format: date
        timezone:
          type: string
          description: IANA time zone, e.g., `America/Chicago`.
        kickoff_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the game started, ISO 8601 with its UTC offset; `null` clears
            the kickoff. Without a `game_date`, it moves the game's date to its
            own.
        roster:
          type: array
          minItems: 1
          maxItems: 200
          items:
            $ref: '#/components/schemas/RosterRow'
          description: >-
            Sets or replaces the game's roster; `null` removes it. Its team
            names and kit colors become the game's. Not with `home_team` or
            `away_team`.
          nullable: true
        home_team:
          $ref: '#/components/schemas/TeamInput'
        away_team:
          $ref: '#/components/schemas/TeamInput'
        periods:
          type: array
          maxItems: 30
          items:
            $ref: '#/components/schemas/Period'
          description: Replaces the game's periods; `[]` clears them.
    Team:
      type: object
      description: A team, known by its side.
      properties:
        team_side:
          type: string
          enum:
            - home
            - away
        name:
          type: string
          nullable: true
        kit_color:
          type: string
          nullable: true
          description: >-
            The outfield kit color, `#RRGGBB`: the roster's, or the one given
            for a game without a roster.
        goalkeeper_kit_color:
          type: string
          nullable: true
    Period:
      type: object
      required:
        - period
        - start_time
      properties:
        period:
          type: integer
          minimum: 1
          description: 1, 2, … in play order.
        label:
          type: string
          maxLength: 40
          nullable: true
          description: >-
            What the sport calls the period, free text, e.g., `first_half` or
            `q3`.
        start_time:
          type: number
          minimum: 0
          description: >-
            Seconds into the video where the period starts: after the previous
            period's `start_time`, and not before its `end_time`.
        end_time:
          type: number
          minimum: 0
          nullable: true
          description: >-
            Seconds into the video where it ends, after its `start_time`; `null`
            means the next period's start, or the end of the video.
    RosterPlayer:
      type: object
      properties:
        player_id:
          type: string
          nullable: true
          description: >-
            The ID the game's data uses for this person: team and shirt number,
            e.g., `home_7`. `null` for an official, or a player without a team
            or number.
        team_side:
          type: string
          enum:
            - home
            - away
          nullable: true
        shirt_number:
          type: integer
          nullable: true
        name:
          type: string
          nullable: true
        position:
          type: string
          nullable: true
          description: >-
            As written in the roster, e.g., `GK`, `CD-L`, `F`; `REF` and `AR`
            for officials.
        class:
          type: string
          enum:
            - player
            - goalkeeper
            - referee
          description: >-
            Kind of person: `GK` is a goalkeeper, `REF` and `AR` are officials
            (`referee`).
        athlete_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Linked Uplift athlete. Not populated yet: always `null` in the
            preview.
        club_player_id:
          type: string
          nullable: true
          description: The roster's own `player_id`, when given.
    Error:
      type: object
      properties:
        error:
          type: string
          description: A short error code representing the type of error.
        message:
          type: string
          description: A detailed message explaining the error.
        problems:
          type: array
          items:
            type: string
          description: >-
            Create Game and Update Game: why the roster is not valid, up to 25,
            each naming its row.
        missing_parts:
          type: array
          items:
            type: integer
          description: 'Complete Upload: the parts to upload again.'
    RosterRow:
      type: object
      description: >-
        One row of the roster. Officials have no team or shirt number. Each team
        needs exactly one outfield kit color and, when its goalkeeper played,
        one goalkeeper color; a row without a color takes its kit's.
      properties:
        team:
          type: string
          enum:
            - home
            - away
            - ''
          description: Required for a player who played (`starter` or `subbed_in`).
        team_name:
          type: string
          description: >-
            Optional. The team's display name, the same on every row of the
            team.
        jersey:
          type: integer
          description: Shirt number, once per team; required for a player who played.
        name:
          type: string
          description: >-
            May be empty: the player is then known by team and number, e.g.,
            `home_9`.
        position:
          type: string
          description: >-
            Any text for a player, kept as written. `GK` marks a goalkeeper;
            `REF` and `AR` mark officials.
        starter:
          type: boolean
        subbed_in:
          type: boolean
        subbed_out:
          type: boolean
        sub_minute:
          type: string
          description: e.g., `57'`, `45+2'` or `45';80'`; empty when not substituted.
        kit_color:
          type: string
          description: '`#RRGGBB`, or empty to take the team''s kit.'
        height_cm:
          type: integer
          minimum: 100
          maximum: 230
          description: Optional.
        player_id:
          type: string
          description: Optional. Your own ID for the player, returned as `club_player_id`.
    TeamInput:
      type: object
      description: A team, for a game without a roster.
      properties:
        name:
          type: string
          maxLength: 100
        kit_color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
          description: The outfield kit color, `#RRGGBB`. Give both teams' or neither.
        goalkeeper_kit_color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
          description: Optional. The goalkeeper's kit color.
  responses:
    Unauthorized:
      description: Unauthorized. Bearer token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
            message: Bearer token is missing or invalid.
    Forbidden:
      description: Forbidden. You do not have permission to access this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Forbidden
            message: You do not have permission to access this resource.
    TooManyRequests:
      description: Too Many Requests. The rate limit has been exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: TooManyRequests
            message: The rate limit has been exceeded. Please wait and try again later.
    InternalServerError:
      description: Internal Server Error. Something went wrong on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: InternalServerError
            message: >-
              An unexpected error occurred on the server. Please try again
              later.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.