# Update an opponent

Section: Your data › PVP tracker › Opponents

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

Updates `name`, `opponentName` and/or `opponentStudentRepId`.

**Parameters**

- `seasonId` (path): The season id.
- `presetId` (path): The opponent preset id.

## Authentication

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

## Path parameters

| Name | Value |
| --- | --- |
| `seasonId` |  |
| `presetId` |  |

## Headers

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

## Body

Content type: `application/json`

```json
{
  "opponentStudentRepId": "hoshino"
}
```

## Example responses

### 200 OK

```json
{
  "data": {
    "id": "md72rqbddfd4jdhq9e32xxq62n8e81q1",
    "createdAt": "2026-09-12T18:28:33.292Z",
    "name": "ペロロ推し",
    "latestTeam": [
      {
        "studentId": "iori"
      },
      {
        "studentId": "eimi"
      },
      {
        "studentId": "hoshino_battle_dealer"
      },
      {
        "studentId": "hoshino"
      },
      {
        "studentId": "michiru_dress"
      },
      {
        "studentId": "atsuko_swimsuit"
      }
    ],
    "opponentName": "ペロロ推し",
    "opponentStudentRepId": "hoshino",
    "seasonId": "kh73y62jqqhmwbxbnrtpdfe7w18dydwx"
  }
}
```

## Examples

### cURL

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

### JavaScript

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

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

### Python

```python
import requests

url = "https://ba.joexyz.online/api/v1/me/pvp/seasons/:seasonId/enemy-presets/:presetId"
headers = {
    "Authorization": "Bearer {{api_key}}",
}
payload = {
    "opponentStudentRepId": "hoshino",
}

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(`{
  "opponentStudentRepId": "hoshino"
}`)

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