# Update a match

Section: Your data › PVP tracker › Matches

```
PATCH https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/matches/:matchId
```

Updates a match. Fields you leave out keep their current values.

**Parameters**

- `seasonId` (path): The season id.
- `matchId` (path): The match id.

## Authentication

Bearer Token — `Authorization: Bearer <token>` (inherited from folder "Your data")

## Path parameters

| Name | Value |
| --- | --- |
| `seasonId` |  |
| `matchId` |  |

## Headers

| Name | Value |
| --- | --- |
| `Content-Type` | `application/json` |

## Body

Content type: `application/json`

```json
{
  "result": "loss"
}
```

## Example responses

### 200 OK

```json
{
  "data": {
    "id": "kd7c9s359tzb40zpp1xxr5m23d8e96ye",
    "createdAt": "2026-09-12T18:25:20.987Z",
    "date": 1789074000000,
    "enemyPresetId": "md7bhbqc3pdtptx2w6xkj2kv3d8e2pcz",
    "matchType": "attack",
    "opponentName": "Hinanbu",
    "opponentStudentRepId": "misaka_mikoto",
    "opponentTeam": [
      {
        "studentId": "shun",
        "damage": 584686
      },
      {
        "studentId": "hoshino_battle_dealer",
        "damage": 139014
      },
      {
        "studentId": "marina",
        "damage": 58185
      },
      {
        "studentId": "shiroko_terror",
        "damage": 1631926
      },
      {
        "studentId": "hibiki",
        "damage": 2059301
      },
      {
        "studentId": "shiroko_swimsuit",
        "damage": 0
      }
    ],
    "opponentTeamKey": "68a885102ce96189",
    "ownTeam": [
      {
        "studentId": "shiroko_terror",
        "damage": 1513971
      },
      {
        "studentId": "yuuka",
        "damage": 110235
      },
      {
        "studentId": "mika",
        "damage": 334593
      },
      {
        "studentId": "eimi",
        "damage": 224859
      },
      {
        "studentId": "reisa_magical",
        "damage": 5599
      },
      {
        "studentId": "utaha",
        "damage": 327809
      }
    ],
    "ownTeamKey": "87c5db1146f598f0",
    "result": "loss",
    "seasonId": "kh73y62jqqhmwbxbnrtpdfe7w18dydwx"
  }
}
```

## Examples

### cURL

```bash
curl -X PATCH https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/matches/:matchId \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{api_key}}' \
  --data-raw '{
  "result": "loss"
}'
```

### JavaScript

```javascript
const response = await fetch("https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/matches/:matchId", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer {{api_key}}",
  },
  body: JSON.stringify({
    "result": "loss"
  }),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/matches/:matchId"
headers = {
    "Authorization": "Bearer {{api_key}}",
}
payload = {
    "result": "loss",
}

response = requests.patch(url, headers=headers, json=payload)
print(response.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "result": "loss"
}`)

	req, err := http.NewRequest("PATCH", "https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/matches/:matchId", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Authorization", "Bearer {{api_key}}")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
```
