# Update an enemy team

Section: Your data › PVP tracker › Enemy teams

```
PATCH https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/enemy-teams/:teamId
```

Updates `matchType` and/or `team`. If the new students match another saved team of the same opponent, the two are merged and that team is returned (with its own `id`).

**Parameters**

- `seasonId` (path): The season id.
- `teamId` (path): The enemy team id.

## Authentication

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

## Path parameters

| Name | Value |
| --- | --- |
| `seasonId` |  |
| `teamId` |  |

## Headers

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

## Body

Content type: `application/json`

```json
{
  "matchType": "both"
}
```

## Example responses

### 200 OK

```json
{
  "data": {
    "id": "mx79k2hd4rqf3wv8ntc6e1jpbs8g5y0a",
    "createdAt": "2026-09-25T21:42:13.511Z",
    "seasonId": "kh73y62jqqhmwbxbnrtpdfe7w18dydwx",
    "enemyPresetId": "md72rqbddfd4jdhq9e32xxq62n8e81q1",
    "teamKey": "8dab5837290edda8",
    "team": [
      {
        "studentId": "iori"
      },
      {
        "studentId": "eimi"
      },
      {
        "studentId": "hoshino_battle_dealer"
      },
      {
        "studentId": "hoshino"
      },
      {
        "studentId": "michiru_dress"
      },
      {
        "studentId": "atsuko_swimsuit"
      }
    ],
    "matchType": "both",
    "updatedAt": 1790372533511
  }
}
```

## Examples

### cURL

```bash
curl -X PATCH https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/enemy-teams/:teamId \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{api_key}}' \
  --data-raw '{
  "matchType": "both"
}'
```

### JavaScript

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

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

### Python

```python
import requests

url = "https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/enemy-teams/:teamId"
headers = {
    "Authorization": "Bearer {{api_key}}",
}
payload = {
    "matchType": "both",
}

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(`{
  "matchType": "both"
}`)

	req, err := http.NewRequest("PATCH", "https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/enemy-teams/:teamId", 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))
}
```
