# GET /tournaments/:id

Get a single tournament.

### Tournament Structure

The tournament object is structured hierarchically to accommodate various competition formats and complexities. Here's a breakdown of its main components:

#### Disciplines

Disciplines represent different categories or events within a tournament. Examples include:

- Open Singles
- Open Doubles
- Men's Doubles
- Women's Singles
- ...

#### EntryType

The `entryType` defines what type of participants are playing in a discipline. 

| EntryType | Description |
|-----------|-------------|
| `single` | Represents individual participants. Each entry is a single player competing on their own. |
| `team_name` | Represents named teams. Entries are teams with specific names. No players are assigned. |
| `dyp` | Stands for "Draw Your Partner". In this format, players are paired before the tournament starts. During the tournament, the teams are fixed. |
| `byp` | Stands for "Bring Your Partner". Players enter the tournament with a chosen partner, forming a fixed team throughout the event. |
| `monster_dyp` | Individual players participate and are assigned to new teams every round. |

#### Stages

Stages represent distinct phases of a tournament within a discipline. Common stages include:

- Preliminary Round
- Elimination Round

#### Valid states

| StageState | Description |
|------------|-------------|
| `planned` | The stage is set up but not yet ready to begin. It may still be in the configuration or preparation phase. |
| `ready` | The stage is fully configured and ready to start. All necessary preparations are complete, but matches haven't begun. |
| `running` | The stage is currently active. Matches are being played or are scheduled to be played in this stage. |
| `finished` | All matches in the stage have been completed. The stage is no longer active and its results are final. |

#### Groups

Groups are the fundamental units of competition within a stage. Every stage has at least one group, but can have multiple depending on the tournament format:

- In a round-robin format (like the soccer World Cup), a stage might have multiple groups where teams play against others in their group.
- In elimination formats, multiple groups can represent different elimination trees

Groups define the tournament mode, such as Swiss system, round-robin, or single elimination. They contain the matches and standings for that part of the competition. The states are the same as the states in the stage.

Currently following tournament modes are implemented:
- `double_elimination`
- `elimination`
- `last_one_standing`
- `lord_have_mercy`
- `monster_dyp`
- `round_robin`
- `rounds`
- `snake_draw`
- `swiss`
- `dutch_system`
- `whist`

#### Group Options

Group options define specific settings and rules for how matches are conducted within a group:

##### Match Configurations
Match configurations set the rules for how games are played and scored. 

| Option | Description |
|--------|-------------|
| `name` | The name of the match configuration (e.g., "Encounter 1", "Team 1 vs Team 1", "Single") is chosen by the Tournament Admin and should only be displayed if more than one configuration is set up. |
| `draw` | Boolean indicating whether matches can end in a draw |
| `numPoints` | Number of points needed to win a set |
| `numSets` | Number of won sets needed to win the match |
| `twoAhead` | Boolean indicating whether a player must win by two points |
| `quickEntry` | Boolean enabling simplified score entry mode, in this case scores a either 1 or 0 |

##### Additional Settings

Some tournament modes have specific options:

| Option | Description |
|--------|-------------|
| `eliminationThirdPlace` | Boolean indicating whether a third-place match will be played in elimination formats |

## Parameters

| Parameter | In | Example |
| --- | --- | --- |
| `id` | path | `tio:4AHchFkVAecs2` |

## Responses

```json
{
  "id": "tio:T5MMiW8IVuWMp",
  "name": "SaDo",
  "description": "",
  "startTime": "2024-04-27T14:20:00.772Z",
  "endTime": "2024-04-27T14:20:00.772Z",
  "state": "running",
  "disciplines": [
    {
      "id": "tio:I8QZl6uRnsvta",
      "name": "Discipline 1",
      "shortName": "D1",
      "entryType": "byp",
      "stages": [
        {
          "id": "tio:zDbCy8RMvgoBF",
          "state": "running",
          "groups": [
            {
              "id": "tio:N2qVwj1OZyQXK",
              "name": "COMMON-QUALIFICATION",
              "tournamentMode": "swiss",
              "state": "running",
              "options": {
                "eliminationThirdPlace": false,
                "matchConfigurations": [
                  {
                    "name": "Encounter 1",
                    "draw": false,
                    "numPoints": 7,
                    "numSets": 1,
                    "twoAhead": false,
                    "quickEntry": false
                  }
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}
```