# Config

Each server exposes public information regarding supported videos and options.


## Get instance public configuration

`GET /api/v1/config`

Authentication: no security requirement declared for this operation.

Responses:

- 200: successful operation

Content type: application/json

Type: ServerConfig

Schema: [ServerConfig](https://docs.joinpeertube.org/api-rest-reference/api/models/serverconfig.md)

- `instance` (optional)
  Type: object
  
  - `name` (optional)
    Type: string
  
  - `shortDescription` (optional)
    Type: string
  
  - `defaultClientRoute` (optional)
    Type: string
  
  - `isNSFW` (optional)
    Type: boolean
  
  - `defaultNSFWPolicy` (optional)
    Type: string
  
  - `serverCountry` (optional)
    Type: string
  
  - `defaultLanguage` (optional)
    Type: string
  
  - `support` (optional)
    Type: object
    
    - `text` (optional)
      Type: string
  
  - `social` (optional)
    Type: object
    
    - `externalLink` (optional)
      Type: string
    
    - `mastodonLink` (optional)
      Type: string
    
    - `blueskyLink` (optional)
      Type: string
    
    - `xLink` (optional)
      Type: string
  
  - `customizations` (optional)
    Type: object
    
    - `javascript` (optional)
      Type: string
    
    - `css` (optional)
      Type: string
  
  - `avatars` (optional)
    Type: Array<ActorImage>
    
    Items:
      Reference: [ActorImage](https://docs.joinpeertube.org/api-rest-reference/api/models/actorimage.md); Type: ActorImage
  
  - `banners` (optional)
    Type: Array<ActorImage>
    
    Items:
      Reference: [ActorImage](https://docs.joinpeertube.org/api-rest-reference/api/models/actorimage.md); Type: ActorImage

- `search` (optional)
  Type: object
  
  - `remoteUri` (optional)
    Type: object
    
    - `users` (optional)
      Type: boolean
    
    - `anonymous` (optional)
      Type: boolean

- `plugin` (optional)
  Type: object
  
  - `registered` (optional)
    Type: Array<string>
    
    Items:
      Type: string

- `theme` (optional)
  Type: object
  
  - `registered` (optional)
    Type: Array<string>
    
    Items:
      Type: string

- `email` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean

- `contactForm` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean

- `serverVersion` (optional)
  Type: string

- `serverCommit` (optional)
  Type: string

- `signup` (optional)
  Type: object
  
  - `allowed` (optional)
    Type: boolean
  
  - `allowedForCurrentIP` (optional)
    Type: boolean
  
  - `requiresEmailVerification` (optional)
    Type: boolean

- `transcoding` (optional)
  Type: object
  
  - `hls` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean
  
  - `web_videos` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean
  
  - `enabledResolutions` (optional)
    Type: Array<VideoResolutionSet>
    
    Items:
      Reference: [VideoResolutionSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videoresolutionset.md); Type: VideoResolutionSet
      
      Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`)
      
      `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos.
      
      
      Example:
      
      ```json
      240
      ```

- `import` (optional)
  Type: object
  
  - `videos` (optional)
    Type: object
    
    - `http` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean
    
    - `torrent` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean
  
  - `videoChannelSynchronization` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean
  
  - `users` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean
    
    - `resumableUpload` (optional)
      Type: object
      
      - `minChunkSize` (optional)
        Type: number
        
        In bytes. Minimum size of a user archive import chunk (except the last one), `0` if there is no minimum

- `export` (optional)
  Type: object
  
  - `users` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean
    
    - `exportExpiration` (optional)
      Type: number
      
      In milliseconds
    
    - `maxUserVideoQuota` (optional)
      Type: number
      
      In bytes

- `autoBlacklist` (optional)
  Type: object
  
  - `videos` (optional)
    Type: object
    
    - `ofUsers` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean

- `blocklist` (optional)
  Type: object
  
  - `publicLog` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean

- `avatar` (optional)
  Type: object
  
  - `file` (optional)
    Type: object
    
    - `size` (optional)
      Type: object
      
      - `max` (optional)
        Type: integer
  
  - `extensions` (optional)
    Type: Array<string>
    
    Items:
      Type: string

- `video` (optional)
  Type: object
  
  - `image` (optional)
    Type: object
    
    - `extensions` (optional)
      Type: Array<string>
      
      Items:
        Type: string
    
    - `size` (optional)
      Type: object
      
      - `max` (optional)
        Type: integer
  
  - `file` (optional)
    Type: object
    
    - `extensions` (optional)
      Type: Array<string>
      
      Items:
        Type: string

- `videoCaption` (optional)
  Type: object
  
  - `file` (optional)
    Type: object
    
    - `size` (optional)
      Type: object
      
      - `max` (optional)
        Type: integer
    
    - `extensions` (optional)
      Type: Array<string>
      
      Items:
        Type: string

- `user` (optional)
  Type: object
  
  - `videoQuota` (optional)
    Type: integer
    
    In bytes
    
    Example:
    
    ```json
    16810141515
    ```
  
  - `videoQuotaDaily` (optional)
    Type: integer
    
    In bytes
    
    Example:
    
    ```json
    1681014151
    ```

- `trending` (optional)
  Type: object
  
  - `videos` (optional)
    Type: object
    
    - `intervalDays` (optional)
      Type: integer

- `tracker` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean

- `followings` (optional)
  Type: object
  
  - `instance` (optional)
    Type: object
    
    - `autoFollowIndex` (optional)
      Type: object
      
      - `indexUrl` (optional)
        Type: string, url

- `federation` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean

- `homepage` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean

- `openTelemetry` (optional)
  Type: object
  
  PeerTube >= 6.1
  
  - `metrics` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean
    
    - `playbackStatsInterval` (optional)
      Type: number
      
      Milliseconds

- `views` (optional)
  Type: object
  
  PeerTube >= 6.1
  
  - `videos` (optional)
    Type: object
    
    - `countViewAfter` (optional)
      Type: number
      
      Milliseconds
    
    - `watchingInterval` (optional)
      Type: object
      
      - `anonymous` (optional)
        Type: number
        
        Milliseconds
      
      - `users` (optional)
        Type: number
        
        Milliseconds

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/config'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://peertube2.cpy.re/api/v1/config')
print(response.text)
```


## Get instance "About" information

`GET /api/v1/config/about`

Translatable information is returned in the language of the request, using the `x-peertube-language` header
or the `Accept-Language` header. If the instance has no translation for this language, the default information is returned.


Authentication: no security requirement declared for this operation.

Parameters:

- `x-peertube-language` (header, string, optional) - Locale of the web interface (`fr-FR`, `pt-BR`...) used to translate the instance information
  Type: string

Responses:

- 200: successful operation

Content type: application/json

Type: ServerConfigAbout

Schema: [ServerConfigAbout](https://docs.joinpeertube.org/api-rest-reference/api/models/serverconfigabout.md)

- `instance` (optional)
  Type: object
  
  - `name` (optional)
    Type: string
  
  - `shortDescription` (optional)
    Type: string
  
  - `description` (optional)
    Type: string
  
  - `terms` (optional)
    Type: string
  
  - `codeOfConduct` (optional)
    Type: string
  
  - `hardwareInformation` (optional)
    Type: string
  
  - `creationReason` (optional)
    Type: string
  
  - `moderationInformation` (optional)
    Type: string
  
  - `administrator` (optional)
    Type: string
  
  - `maintenanceLifetime` (optional)
    Type: string
  
  - `businessModel` (optional)
    Type: string
  
  - `support` (optional)
    Type: object
    
    - `text` (optional)
      Type: string
  
  - `languages` (optional)
    Type: Array<string>
    
    Items:
      Type: string
  
  - `categories` (optional)
    Type: Array<integer>
    
    Items:
      Type: integer
  
  - `avatars` (optional)
    Type: Array<ActorImage>
    
    Items:
      Reference: [ActorImage](https://docs.joinpeertube.org/api-rest-reference/api/models/actorimage.md); Type: ActorImage
  
  - `banners` (optional)
    Type: Array<ActorImage>
    
    Items:
      Reference: [ActorImage](https://docs.joinpeertube.org/api-rest-reference/api/models/actorimage.md); Type: ActorImage

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/config/about'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config/about', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://peertube2.cpy.re/api/v1/config/about')
print(response.text)
```


## Get instance runtime configuration

`GET /api/v1/config/custom`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Responses:

- 200: successful operation

Content type: application/json

Type: ServerConfigCustom

Schema: [ServerConfigCustom](https://docs.joinpeertube.org/api-rest-reference/api/models/serverconfigcustom.md)

- `instance` (optional)
  Type: object
  
  - `name` (optional)
    Type: string
  
  - `shortDescription` (optional)
    Type: string
  
  - `description` (optional)
    Type: string
  
  - `terms` (optional)
    Type: string
  
  - `codeOfConduct` (optional)
    Type: string
  
  - `creationReason` (optional)
    Type: string
  
  - `moderationInformation` (optional)
    Type: string
  
  - `administrator` (optional)
    Type: string
  
  - `maintenanceLifetime` (optional)
    Type: string
  
  - `businessModel` (optional)
    Type: string
  
  - `hardwareInformation` (optional)
    Type: string
  
  - `translations` (optional)
    Type: Array<InstanceTranslation>
    
    Translations of the instance information. Empty fields fall back to the default instance information
    
    Items:
      Reference: [InstanceTranslation](https://docs.joinpeertube.org/api-rest-reference/api/models/instancetranslation.md); Type: InstanceTranslation
  
  - `languages` (optional)
    Type: Array<string>
    
    Items:
      Type: string
  
  - `categories` (optional)
    Type: Array<number>
    
    Items:
      Type: number
  
  - `isNSFW` (optional)
    Type: boolean
  
  - `defaultNSFWPolicy` (optional)
    Type: string
  
  - `serverCountry` (optional)
    Type: string
  
  - `support` (optional)
    Type: object
    
    - `text` (optional)
      Type: string
  
  - `social` (optional)
    Type: object
    
    - `externalLink` (optional)
      Type: string
    
    - `mastodonLink` (optional)
      Type: string
    
    - `blueskyLink` (optional)
      Type: string
    
    - `xLink` (optional)
      Type: string
  
  - `defaultClientRoute` (optional)
    Type: string
  
  - `customizations` (optional)
    Type: object
    
    - `javascript` (optional)
      Type: string
    
    - `css` (optional)
      Type: string

- `theme` (optional)
  Type: object
  
  - `default` (optional)
    Type: string

- `services` (optional)
  Type: object
  
  - `twitter` (optional)
    Type: object
    
    - `username` (optional)
      Type: string

- `cache` (optional)
  Type: object
  
  - `previews` (optional)
    Type: object
    
    - `size` (optional)
      Type: integer
  
  - `captions` (optional)
    Type: object
    
    - `size` (optional)
      Type: integer

- `signup` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean
  
  - `limit` (optional)
    Type: integer
  
  - `requiresEmailVerification` (optional)
    Type: boolean

- `admin` (optional)
  Type: object
  
  - `email` (optional)
    Type: string, email

- `contactForm` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean

- `user` (optional)
  Type: object
  
  Settings that apply to new users, if registration is enabled
  
  - `videoQuota` (optional)
    Type: integer
    
    Example:
    
    ```json
    16810141515
    ```
  
  - `videoQuotaDaily` (optional)
    Type: integer
    
    Example:
    
    ```json
    1681014151
    ```

- `transcoding` (optional)
  Type: object
  
  Settings pertaining to transcoding jobs
  
  - `enabled` (optional)
    Type: boolean
  
  - `originalFile` (optional)
    Type: object
    
    - `keep` (optional)
      Type: boolean
  
  - `allowAdditionalExtensions` (optional)
    Type: boolean
    
    Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos
  
  - `allowAudioFiles` (optional)
    Type: boolean
    
    If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
  
  - `threads` (optional)
    Type: integer
    
    Amount of threads used by ffmpeg for 1 transcoding job
  
  - `concurrency` (optional)
    Type: number
    
    Amount of transcoding jobs to execute in parallel
  
  - `profile` (optional)
    Type: string
    
    New profiles can be added by plugins ; available in core PeerTube: 'default'.
    
    
    enum: ["default"]
  
  - `resolutions` (optional)
    Type: object
    
    Resolutions to transcode _new videos_ to
    
    - `0p` (optional)
      Type: boolean
    
    - `144p` (optional)
      Type: boolean
    
    - `240p` (optional)
      Type: boolean
    
    - `360p` (optional)
      Type: boolean
    
    - `480p` (optional)
      Type: boolean
    
    - `720p` (optional)
      Type: boolean
    
    - `1080p` (optional)
      Type: boolean
    
    - `1440p` (optional)
      Type: boolean
    
    - `2160p` (optional)
      Type: boolean
  
  - `web_videos` (optional)
    Type: object
    
    Web Video specific settings
    
    - `enabled` (optional)
      Type: boolean
  
  - `hls` (optional)
    Type: object
    
    HLS specific settings
    
    - `enabled` (optional)
      Type: boolean
    
    - `splitAudioAndVideo` (optional)
      Type: boolean

- `import` (optional)
  Type: object
  
  - `videos` (optional)
    Type: object
    
    - `http` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean
    
    - `torrent` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean
  
  - `video_channel_synchronization` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean

- `autoBlacklist` (optional)
  Type: object
  
  - `videos` (optional)
    Type: object
    
    - `ofUsers` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean

- `blocklist` (optional)
  Type: object
  
  - `publicLog` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean

- `followers` (optional)
  Type: object
  
  - `instance` (optional)
    Type: object
    
    - `enabled` (optional)
      Type: boolean
    
    - `manualApproval` (optional)
      Type: boolean

- `storyboard` (optional)
  Type: object
  
  - `enabled` (optional)
    Type: boolean

- `defaults` (optional)
  Type: object
  
  - `publish` (optional)
    Type: object
    
    - `downloadEnabled` (optional)
      Type: boolean
    
    - `commentsPolicy` (optional)
      Reference: [VideoCommentsPolicySet](https://docs.joinpeertube.org/api-rest-reference/api/models/videocommentspolicyset.md); Type: VideoCommentsPolicySet
      
      Comments policy of the video (Enabled = `1`, Disabled = `2`, Requires Approval = `3`)
      
      enum: [1,2,3]
    
    - `recommendationScope` (optional)
      Reference: [VideoRecommendationScopeSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videorecommendationscopeset.md); Type: VideoRecommendationScopeSet
      
      Videos that can be recommended next to a video:
        - `1` All videos
        - `2` Only videos of the platform that owns the reference video (or of the current platform if no video is given)
        - `3` Only videos of the account that owns the reference video
        - `4` Only videos of the channel of the reference video
      
      This is a preference of the video owner: applications displaying recommendations may not apply it
      
      
      enum: [1,2,3,4]
    
    - `privacy` (optional)
      Reference: [VideoPrivacySet](https://docs.joinpeertube.org/api-rest-reference/api/models/videoprivacyset.md); Type: VideoPrivacySet
      
      privacy id of the video (see [/videos/privacies](https://docs.joinpeertube.org/api-rest-reference/api/operations/getvideoprivacypolicies.html))
      
      enum: [1,2,3,4,5]
    
    - `licence` (optional)
      Reference: [VideoLicenceSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videolicenceset.md); Type: VideoLicenceSet
      
      licence id of the video (see [/videos/licences](https://docs.joinpeertube.org/api-rest-reference/api/operations/getlicences.html))
      
      Example:
      
      ```json
      2
      ```
  
  - `p2p` (optional)
    Type: object
    
    - `webapp` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean
    
    - `embed` (optional)
      Type: object
      
      - `enabled` (optional)
        Type: boolean
  
  - `player` (optional)
    Type: object
    
    - `autoPlay` (optional)
      Type: boolean

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/config/custom' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config/custom', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.get(
    'https://peertube2.cpy.re/api/v1/config/custom',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Set instance runtime configuration

`PUT /api/v1/config/custom`

Changing `instance.customizations.javascript` or `instance.customizations.css` requires a [password confirmation](https://docs.joinpeertube.org/api-rest-reference/api.md#password-confirmation): set `currentPassword` at the root of the request body.


Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Responses:

- 200: successful operation

- 400: Arises when:
  - the emailer is disabled and the instance is open to registrations
  - web videos and hls are disabled with transcoding enabled - you need at least one enabled
  - the custom JavaScript or CSS changed and `currentPassword` is missing


- 403: invalid `currentPassword`, or password confirmation unavailable for this user

- 429: too many failed password confirmations

## Examples

### cURL

```bash
curl -X PUT 'https://peertube2.cpy.re/api/v1/config/custom' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config/custom', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.put(
    'https://peertube2.cpy.re/api/v1/config/custom',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Delete instance runtime configuration

`DELETE /api/v1/config/custom`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Responses:

- 200: successful operation

## Examples

### cURL

```bash
curl -X DELETE 'https://peertube2.cpy.re/api/v1/config/custom' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config/custom', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.delete(
    'https://peertube2.cpy.re/api/v1/config/custom',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Update instance banner

`POST /api/v1/config/instance-banner/pick`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Request body: multipart/form-data

Type: object

- `bannerfile` (optional)
  Type: string, binary
  
  The file to upload.

Responses:

- 204: successful operation

- 413: image file too large

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/config/instance-banner/pick' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const form = new FormData();
const response = await fetch('https://peertube2.cpy.re/api/v1/config/instance-banner/pick', {
  method: 'POST',
  headers: {"Authorization":"Bearer YOUR_TOKEN"},
  body: form,
});
console.log(await response.text());
```

### Python

```python
import requests
from contextlib import ExitStack

with ExitStack() as stack:
    files = [
    ]
    response = requests.request('POST', 'https://peertube2.cpy.re/api/v1/config/instance-banner/pick', headers={"Authorization":"Bearer YOUR_TOKEN"}, files=files)
    print(response.text)
```


## Delete instance banner

`DELETE /api/v1/config/instance-banner`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Responses:

- 204: successful operation

## Examples

### cURL

```bash
curl -X DELETE 'https://peertube2.cpy.re/api/v1/config/instance-banner' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config/instance-banner', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.delete(
    'https://peertube2.cpy.re/api/v1/config/instance-banner',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Update instance avatar

`POST /api/v1/config/instance-avatar/pick`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Request body: multipart/form-data

Type: object

- `avatarfile` (optional)
  Type: string, binary
  
  The file to upload.

Responses:

- 204: successful operation

- 413: image file too large

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/config/instance-avatar/pick' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const form = new FormData();
const response = await fetch('https://peertube2.cpy.re/api/v1/config/instance-avatar/pick', {
  method: 'POST',
  headers: {"Authorization":"Bearer YOUR_TOKEN"},
  body: form,
});
console.log(await response.text());
```

### Python

```python
import requests
from contextlib import ExitStack

with ExitStack() as stack:
    files = [
    ]
    response = requests.request('POST', 'https://peertube2.cpy.re/api/v1/config/instance-avatar/pick', headers={"Authorization":"Bearer YOUR_TOKEN"}, files=files)
    print(response.text)
```


## Delete instance avatar

`DELETE /api/v1/config/instance-avatar`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Responses:

- 204: successful operation

## Examples

### cURL

```bash
curl -X DELETE 'https://peertube2.cpy.re/api/v1/config/instance-avatar' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config/instance-avatar', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.delete(
    'https://peertube2.cpy.re/api/v1/config/instance-avatar',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Update instance logo

`POST /api/v1/config/instance-logo/{logoType}/pick`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Parameters:

- `logoType` (path, string, required)
  Type: string
  
  enum: ["favicon","header-wide","header-square","opengraph"]

Request body: multipart/form-data

Type: object

- `logofile` (optional)
  Type: string, binary
  
  The file to upload.

Responses:

- 204: successful operation

- 413: image file too large

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/config/instance-logo/favicon/pick' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const form = new FormData();
const response = await fetch('https://peertube2.cpy.re/api/v1/config/instance-logo/favicon/pick', {
  method: 'POST',
  headers: {"Authorization":"Bearer YOUR_TOKEN"},
  body: form,
});
console.log(await response.text());
```

### Python

```python
import requests
from contextlib import ExitStack

with ExitStack() as stack:
    files = [
    ]
    response = requests.request('POST', 'https://peertube2.cpy.re/api/v1/config/instance-logo/favicon/pick', headers={"Authorization":"Bearer YOUR_TOKEN"}, files=files)
    print(response.text)
```


## Delete instance logo

`DELETE /api/v1/config/instance-logo/{logoType}`

Authentication (security requirement alternatives):

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

- 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
; scopes: admin

Parameters:

- `logoType` (path, string, required)
  Type: string
  
  enum: ["favicon","header-wide","header-square","opengraph"]

Responses:

- 204: successful operation

## Examples

### cURL

```bash
curl -X DELETE 'https://peertube2.cpy.re/api/v1/config/instance-logo/favicon' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/config/instance-logo/favicon', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

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

### Python

```python
import requests

response = requests.delete(
    'https://peertube2.cpy.re/api/v1/config/instance-logo/favicon',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
