# Update channel player settings

`PUT /api/v1/player-settings/video-channels/{channelHandle}`

Update default player settings for a video channel.

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": []
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started


Parameters:

- `channelHandle` (path, string, required) - The video channel handle
  Type: string
  
  Example:
  
  ```json
  "my_username | my_username@example.com"
  ```

Request body: application/json

Type: PlayerChannelSettingsUpdate

Player settings update for a channel

Schema: [PlayerChannelSettingsUpdate](https://sourcey-peertube.pages.dev/api-rest-reference/models/playerchannelsettingsupdate.md)

- `theme` (required)
  Reference: [PlayerThemeChannelSetting](https://sourcey-peertube.pages.dev/api-rest-reference/models/playerthemechannelsetting.md); Type: PlayerThemeChannelSetting
  
  Player theme setting for a channel:
    - `instance-default` Use the instance default theme
    - `galaxy` Use the galaxy theme
    - `lucide` Use the lucide theme
  
  
  enum: ["instance-default","galaxy","lucide"]

Responses:

- 200: successful operation

Content type: application/json

Type: PlayerChannelSettings

Player settings for a channel

Schema: [PlayerChannelSettings](https://sourcey-peertube.pages.dev/api-rest-reference/models/playerchannelsettings.md)

- `theme` (optional)
  Reference: [PlayerThemeChannelSetting](https://sourcey-peertube.pages.dev/api-rest-reference/models/playerthemechannelsetting.md); Type: PlayerThemeChannelSetting
  
  Player theme setting for a channel:
    - `instance-default` Use the instance default theme
    - `galaxy` Use the galaxy theme
    - `lucide` Use the lucide theme
  
  
  enum: ["instance-default","galaxy","lucide"]

- 404: video channel not found

## Examples

### cURL

```bash
curl -X PUT 'https://peertube2.cpy.re/api/v1/player-settings/video-channels/my_username%20%7C%20my_username%40example.com' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "theme": "instance-default"
}'
```

### JavaScript

```javascript
const body = `{
  "theme": "instance-default"
}`;

const response = await fetch('https://peertube2.cpy.re/api/v1/player-settings/video-channels/my_username%20%7C%20my_username%40example.com', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "theme": "instance-default"
}'''

response = requests.put(
    'https://peertube2.cpy.re/api/v1/player-settings/video-channels/my_username%20%7C%20my_username%40example.com',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
