# PUT /tournaments/:id/matches/:matchId/result

This endpoint allows you to set the result of a running match within a tournament.

:::caution
Only matches in the state `running` can be updated. If the match has a different state, a 412 status is returned.
:::

### Body
The request body should contain a \`result\` field with the new match result:

```json
{
  "result": [[[1, 7]]]
}
```

The `result` field follows the structure of the `encounters` array described in the match details:

1. Outermost array: Encounters (for league modes like Single/Double/Single)
2. Middle array: Sets within each encounter
3. Innermost array: Actual scores for each set

On successful update (status code 200), the response will contain the updated match object. This object follows the same structure as described in the Get Match Details endpoint.

## Parameters

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

## Request body

```json
{
  "result": [[[1, 7]]]
}
```

## Responses

```json
{
  "id": "tio:dWT5oSbv2kYQg",
  "entries": [
    {
      "id": "05-2553_05-4357",
      "name": "Helmut Poppen / Sophia Poppen"
    },
    {
      "id": "05-9012_05-9876",
      "name": "Caroline Conrad / Andrei Andros"
    }
  ],
  "state": "played",
  "encounters": [
    [
      [
        1,
        7
      ]
    ]
  ],
  "displayScore": [
    1,
    7
  ],
  "courtIds": ["tio:dLUOkXt5oHEvq"],
  "startTime": "2024-07-03T14:39:16.575Z",
  "endTime": "2024-08-09T18:09:36.210Z",
  
  "isLiveResult": false,
  "disciplineId": "tio:JHriFxv2ZBCYD",
  "disciplineName": "[D1] Discipline 1",
  "roundId": "tio:S0U825dvJ8v5a",
  "roundName": "Round 1",
  "groupId": "tio:bEC14gDhxf5pT",
  "groupName": "Qualification"
}
```
```json
{
  "message": "Match is not running",
  "error": "Precondition Failed",
  "statusCode": 412
}
```