> ## 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.

# Phase of Play

> A span of play with each team's phase, in and out of possession.

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

## Technical Details

* **Variable Type:** Segment
* **Segment Type:** `phase_of_play`
* **Returned By:** [List Game Segments](https://docs.uplift.ai/api-reference/game-data/segments/list.md)
* **Filter:** `segment_type=phase_of_play`

## Description

A span of in-play time with a phase for each team: the team in possession and the team out of possession. The segment's `team_id` is the team in possession. Phases cover in-play time with no gaps and stop during a [dead ball](https://docs.uplift.ai/api-reference/game-data/event-catalogue/segments/dead-ball). Each event's `phase` is the in-possession phase.

**In possession:** `build_up`, `create`, `finish`, `quick_break`, `direct`, `set_play`, `chaotic`

**Out of possession:** `high_block`, `medium_block`, `low_block`, `defending_quick_break`, `defending_direct`, `defending_set_play`, `chaotic`

Each value is explained under [Values](#values) below.

Every segment has the same envelope fields: time, frames, team, player, `confidence` and `layer`. See [List Game Segments](https://docs.uplift.ai/api-reference/game-data/segments/list.md). The fields below are specific to this type and are returned in `attributes`.

## Attributes

| Field | Units | Description |
| - | - | - |
| `team_in_possession_phase_type` | — | Phase of the team in possession, from the first list above. |
| `team_out_of_possession_phase_type` | — | Phase of the team out of possession, from the second list above. |
| `previous_phase` | — | In-possession phase before this one. |
| `ended_with` | — | What ended the phase, for example `phase_change`. |
| `team_possession_lead_to_shot` | — | Whether the team possession this phase belongs to led to a shot. |
| `team_possession_lead_to_goal` | — | Whether the team possession this phase belongs to led to a goal. |

## Values

Each team has a phase at every moment of play, and the two come in pairs: the phase of the team with the ball and the matching phase of the team without it. The names follow the industry's common phase-of-play model.

| In possession | Out of possession | Meaning |
| - | - | - |
| `set_play` | `defending_set_play` | A corner, a free kick or a long throw-in played into the penalty area, until the defending team wins or clears the ball, or play stops. |
| `quick_break` | `defending_quick_break` | Winning the ball, then attacking quickly while the opponents run back. |
| `direct` | `defending_direct` | A long ball forward from the team's own half, of about 30 m or more up the pitch, until it is received. |
| `build_up` | `high_block` | The ball in the team's own third, with the opponents pressing or positioned high up the pitch. |
| `create` | `medium_block` | The default phase, usually around the middle third: working the ball forward while the opponents defend in midfield. |
| `finish` | `low_block` | Established possession near the opponent's goal, with their defensive line close to their own penalty area. |
| `chaotic` | `chaotic` | A short, contested spell where neither team has control of the ball, such as a scramble or a clearance under pressure. The same for both teams. |

`build_up`, `create` and `finish` depend on where the ball and the defending team are along the pitch, roughly by thirds.

## Example

Only the type-specific fields and a few envelope fields are shown.

```json theme={null}
{
  "segment_type": "phase_of_play",
  "segment_id": "ph-0417",
  "team_id": "t-0451",
  "team_side": "home",
  "attributes": {
    "team_in_possession_phase_type": "create",
    "team_out_of_possession_phase_type": "medium_block",
    "previous_phase": "build_up",
    "ended_with": "phase_change",
    "team_possession_lead_to_shot": true,
    "team_possession_lead_to_goal": false
  }
}
```

## Related

* [Team Possession](https://docs.uplift.ai/api-reference/game-data/event-catalogue/segments/team-possession)
* [Dead Ball](https://docs.uplift.ai/api-reference/game-data/event-catalogue/segments/dead-ball)
* [Team Shape](https://docs.uplift.ai/api-reference/game-data/event-catalogue/events/team-shape)


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