# Update preferences

Section: Your data › Profile & preferences

```
PATCH https://ba.joexyz.online/api/v1/me/preferences
```

Updates preferences. Each group you send (`timelineVisualizer`,
`formationDisplay`, `bond`, `pvp`) is merged into the stored one.

## Authentication

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

## Headers

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

## Body

Content type: `application/json`

```json
{
  "pvp": {
    "hideEmptyAgendaDays": true
  }
}
```

## Example responses

### 200 OK

```json
{
  "data": {
    "bond": {
      "autoPopulateSingleTargetGifts": false
    },
    "formationDisplay": {
      "defaultDisplayOverline": false,
      "defaultGroupsVertical": false,
      "defaultLevel": 90,
      "defaultLevelEnabled": true,
      "defaultNoDisplayRole": false,
      "defaultRowGap": 8,
      "defaultScale": 4
    },
    "pvp": {
      "hideEmptyAgendaDays": true,
      "includeMatchesInStatisticsByDefault": true
    },
    "timelineVisualizer": {
      "defaultExportBackgroundColor": "#000000",
      "defaultExportBackgroundOpacity": 100,
      "defaultExportWithTransparentBackground": true,
      "defaultHorizontalSeparatorSize": 50,
      "defaultItemSpacing": -6,
      "defaultScale": 4,
      "defaultShowCreator": true,
      "defaultVerticalSeparatorSize": 50,
      "defaultVisibility": "public",
      "triggerAutoFocus": true
    }
  }
}
```

## Examples

### cURL

```bash
curl -X PATCH https://ba.joexyz.online/api/v1/me/preferences \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{api_key}}' \
  --data-raw '{
  "pvp": {
    "hideEmptyAgendaDays": true
  }
}'
```

### JavaScript

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

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

### Python

```python
import requests

url = "https://ba.joexyz.online/api/v1/me/preferences"
headers = {
    "Authorization": "Bearer {{api_key}}",
}
payload = {
    "pvp": {
        "hideEmptyAgendaDays": True,
    },
}

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(`{
  "pvp": {
    "hideEmptyAgendaDays": true
  }
}`)

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