# My User

Operations related to your own User, when logged-in.


## Get my user information

`GET /api/v1/users/me`

Authentication (security requirement alternatives):

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

- 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: user

Responses:

- 200: successful operation

Content type: application/json

Type: Array<User>

Items:
  Reference: [User](https://docs.joinpeertube.org/api-rest-reference/api/models/user.md); Type: User

## Examples

### cURL

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

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me', {
  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/users/me',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Update my user information

`PUT /api/v1/users/me`

Authentication (security requirement alternatives):

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

- 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: user

Request body: application/json (required)

Type: UpdateMe

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

- `password` (optional)
  Reference: [password](https://docs.joinpeertube.org/api-rest-reference/api/models/password.md); Type: password, password
  
  minLength: 6
  
  maxLength: 50

- `currentPassword` (optional)
  Reference: [password](https://docs.joinpeertube.org/api-rest-reference/api/models/password.md); Type: password, password
  
  minLength: 6
  
  maxLength: 50

- `email` (optional)
  Type: email
  
  new email used for login and service communications
  
  allOf:
    Type: email, email
    
    The user email

- `displayName` (optional)
  Type: string
  
  new name of the user in its representations
  
  minLength: 3
  
  maxLength: 120

- `nsfwPolicy` (optional)
  Type: string
  
  new NSFW display policy
  
  enum: ["true","false","both"]

- `nsfwFlagsDisplayed` (optional)
  Reference: [NSFWFlag](https://docs.joinpeertube.org/api-rest-reference/api/models/nsfwflag.md); Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  enum: [0,1,2,4]

- `nsfwFlagsHidden` (optional)
  Reference: [NSFWFlag](https://docs.joinpeertube.org/api-rest-reference/api/models/nsfwflag.md); Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  enum: [0,1,2,4]

- `nsfwFlagsWarned` (optional)
  Reference: [NSFWFlag](https://docs.joinpeertube.org/api-rest-reference/api/models/nsfwflag.md); Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  enum: [0,1,2,4]

- `nsfwFlagsBlurred` (optional)
  Reference: [NSFWFlag](https://docs.joinpeertube.org/api-rest-reference/api/models/nsfwflag.md); Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  enum: [0,1,2,4]

- `aiUsagesHidden` (optional)
  Type: Array<VideoAIUsageSet>
  
  **PeerTube >= 9.0** Videos with these AI usages are hidden from video lists
  
  Items:
    Reference: [VideoAIUsageSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videoaiusageset.md); Type: VideoAIUsageSet
    
    **PeerTube >= 9.0** Use of AI in the video, declared by the video creator:
      - `1` Not specified
      - `2` No AI-generated content: nothing seen or heard in the video has been generated by AI
      - `3` Contains AI-generated content: some parts of the video have been generated by AI
      - `4` AI-generated: the whole video, or most of it, has been generated by AI
    
    
    enum: [1,2,3,4]

- `p2pEnabled` (optional)
  Type: boolean
  
  whether to enable P2P in the player or not

- `autoPlayVideo` (optional)
  Type: boolean
  
  new preference regarding playing videos automatically

- `autoPlayNextVideo` (optional)
  Type: boolean
  
  new preference regarding playing following videos automatically

- `autoPlayNextVideoPlaylist` (optional)
  Type: boolean
  
  new preference regarding playing following playlist videos automatically

- `videosHistoryEnabled` (optional)
  Type: boolean
  
  whether to keep track of watched history or not

- `videoLanguages` (optional)
  Type: Array<string>
  
  list of languages to filter videos down to
  
  Items:
    Type: string

- `videoCategories` (optional)
  Type: Array<integer>; nullable
  
  list of categories to filter videos down to (`null` means all categories)
  
  Items:
    Type: integer

- `videoLive` (optional)
  Type: string
  
  filter videos down to lives (`true`), VODs (`false`) or display both
  
  enum: ["true","false","both"]

- `language` (optional)
  Type: string
  
  default language for this user

- `theme` (optional)
  Type: string

- `noInstanceConfigWarningModal` (optional)
  Type: boolean

- `noAccountSetupWarningModal` (optional)
  Type: boolean

- `noWelcomeModal` (optional)
  Type: boolean

Responses:

- 204: successful operation

## Examples

### cURL

```bash
curl -X PUT 'https://peertube2.cpy.re/api/v1/users/me' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "password": "********",
  "currentPassword": "********",
  "displayName": "string",
  "nsfwPolicy": "true",
  "nsfwFlagsDisplayed": 0,
  "nsfwFlagsHidden": 0,
  "nsfwFlagsWarned": 0,
  "nsfwFlagsBlurred": 0,
  "aiUsagesHidden": [
    1
  ],
  "p2pEnabled": true,
  "autoPlayVideo": true,
  "autoPlayNextVideo": true,
  "autoPlayNextVideoPlaylist": true,
  "videosHistoryEnabled": true,
  "videoLanguages": [
    "string"
  ],
  "videoCategories": [
    0
  ],
  "videoLive": "true",
  "language": "string",
  "theme": "string",
  "noInstanceConfigWarningModal": true,
  "noAccountSetupWarningModal": true,
  "noWelcomeModal": true
}'
```

### JavaScript

```javascript
const body = `{
  "password": "********",
  "currentPassword": "********",
  "displayName": "string",
  "nsfwPolicy": "true",
  "nsfwFlagsDisplayed": 0,
  "nsfwFlagsHidden": 0,
  "nsfwFlagsWarned": 0,
  "nsfwFlagsBlurred": 0,
  "aiUsagesHidden": [
    1
  ],
  "p2pEnabled": true,
  "autoPlayVideo": true,
  "autoPlayNextVideo": true,
  "autoPlayNextVideoPlaylist": true,
  "videosHistoryEnabled": true,
  "videoLanguages": [
    "string"
  ],
  "videoCategories": [
    0
  ],
  "videoLive": "true",
  "language": "string",
  "theme": "string",
  "noInstanceConfigWarningModal": true,
  "noAccountSetupWarningModal": true,
  "noWelcomeModal": true
}`;

const response = await fetch('https://peertube2.cpy.re/api/v1/users/me', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

body = '''{
  "password": "********",
  "currentPassword": "********",
  "displayName": "string",
  "nsfwPolicy": "true",
  "nsfwFlagsDisplayed": 0,
  "nsfwFlagsHidden": 0,
  "nsfwFlagsWarned": 0,
  "nsfwFlagsBlurred": 0,
  "aiUsagesHidden": [
    1
  ],
  "p2pEnabled": true,
  "autoPlayVideo": true,
  "autoPlayNextVideo": true,
  "autoPlayNextVideoPlaylist": true,
  "videosHistoryEnabled": true,
  "videoLanguages": [
    "string"
  ],
  "videoCategories": [
    0
  ],
  "videoLive": "true",
  "language": "string",
  "theme": "string",
  "noInstanceConfigWarningModal": true,
  "noAccountSetupWarningModal": true,
  "noWelcomeModal": true
}'''

response = requests.put(
    'https://peertube2.cpy.re/api/v1/users/me',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Delete my account

`DELETE /api/v1/users/me`

Delete the authenticated user's account and all associated data

Authentication (security requirement alternatives):

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

- 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: user

Responses:

- 204: successful operation - account deleted

- 400: invalid request parameters

- 401: authentication required

## Examples

### cURL

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

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me', {
  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/users/me',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Get video imports of my user

`GET /api/v1/users/me/videos/imports`

Authentication (security requirement alternatives):

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

- 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: user

Parameters:

- `start` (query, integer, optional) - Offset used to paginate results
  Type: integer
  
  minimum: 0

- `count` (query, integer, optional) - Number of items to return
  Type: integer
  
  default: 15
  
  minimum: 1
  
  maximum: 100

- `sort` (query, string, optional) - Sort column
  Type: string
  
  Example:
  
  ```json
  "-createdAt"
  ```

- `includeCollaborations` (query, boolean, optional) - **PeerTube >= 8.0** Include objects from collaborated channels
  Type: boolean

- `videoId` (query, integer, optional) - Filter on import video ID
  Type: integer

- `targetUrl` (query, string, optional) - Filter on import target URL
  Type: string

- `videoChannelSyncId` (query, number, optional) - Filter on imports created by a specific channel synchronization
  Type: number

- `search` (query, string, optional) - Search in video names
  Type: string

- `stateOneOf` (query, Array<id>, optional) - Filter on import state
  Type: Array<id>
  
  Items:
    Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    The video import state (Pending = `1`, Success = `2`, Failed = `3`, Rejected = `4`, Cancelled = `5`, Processing = `6`)
    
    
    enum: [1,2,3,4,5,6]

Responses:

- 200: successful operation

Content type: application/json

Type: VideoImportsList

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

- `total` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `data` (optional)
  Type: Array<VideoImport>
  
  maxItems: 100
  
  Items:
    Reference: [VideoImport](https://docs.joinpeertube.org/api-rest-reference/api/models/videoimport.md); Type: VideoImport

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/users/me/videos/imports?count=15' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/videos/imports?count=15', {
  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/users/me/videos/imports?count=15',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Get my user used quota

`GET /api/v1/users/me/video-quota-used`

Authentication (security requirement alternatives):

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

- 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: user

Responses:

- 200: successful operation

Content type: application/json

Type: object

- `videoQuotaUsed` (optional)
  Type: number
  
  The user video quota used so far in bytes
  
  Example:
  
  ```json
  16810141515
  ```

- `videoQuotaUsedDaily` (optional)
  Type: number
  
  The user video quota used today in bytes
  
  Example:
  
  ```json
  1681014151
  ```

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/users/me/video-quota-used' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/video-quota-used', {
  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/users/me/video-quota-used',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Get rate of my user for a video

`GET /api/v1/users/me/videos/{videoIdOrUUID}/rating`

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:

- `videoIdOrUUID` (path, id | UUIDv4 | shortUUID, required) - Video id or UUID
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://docs.joinpeertube.org/api-rest-reference/api/models/uuidv4.md); Type: UUIDv4, uuid
    
    minLength: 36
    
    maxLength: 36
    
    pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    
    Example:
    
    ```json
    "9c9de5e8-0a1e-484a-b099-e80766180a6d"
    ```
  
    Reference: [shortUUID](https://docs.joinpeertube.org/api-rest-reference/api/models/shortuuid.md); Type: shortUUID
    
    translation of a uuid v4 with a bigger alphabet to have a shorter uuid
    
    Example:
    
    ```json
    "2y84q2MQUMWPbiEcxNXMgC"
    ```

Responses:

- 200: successful operation

Content type: application/json

Type: GetMeVideoRating

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

- `id` (required)
  Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
  
  minimum: 1
  
  Example:
  
  ```json
  42
  ```

- `rating` (required)
  Type: string
  
  Rating of the video
  
  enum: ["like","dislike","none"]

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/users/me/videos/42/rating' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/videos/42/rating', {
  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/users/me/videos/42/rating',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## List videos of my user

`GET /api/v1/users/me/videos`

Authentication (security requirement alternatives):

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

- 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: user

Parameters:

- `channelNameOneOf` (query, string | Array<string>, optional) - **PeerTube >= 7.2** Filter on videos that are published by a channel with one of these names
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    Items:
      Type: string

- `start` (query, integer, optional) - Offset used to paginate results
  Type: integer
  
  minimum: 0

- `count` (query, integer, optional) - Number of items to return
  Type: integer
  
  default: 15
  
  minimum: 1
  
  maximum: 100

- `skipCount` (query, string, optional) - if you don't need the `total` in the response
  Type: string
  
  default: "false"
  
  enum: ["true","false"]

- `sort` (query, string, optional)
  Type: string
  
  Sort videos by criteria (prefixing with `-` means `DESC` order):
    * `hot` - Adaptation of Reddit "hot" algorithm taking into account video views, likes, dislikes and comments and publication date
    * `best` - Same than `hot`, but also takes into account user video history
    * `trending` - Sort videos by recent views ("recent" is defined by the admin)
    * `views` - Sort videos using their `views` counter
    * `publishedAt` - Sort by video publication date (when it became publicly available)
  
  
  enum: ["name","-duration","-createdAt","-publishedAt","-views","-likes","-comments","-trending","-hot","-best"]

- `nsfw` (query, string, optional) - whether to include nsfw videos, if any
  Type: string
  
  enum: ["true","false"]

- `nsfwFlagsIncluded` (query, NSFWFlag, optional)
  Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  Schema: [NSFWFlag](https://docs.joinpeertube.org/api-rest-reference/api/models/nsfwflag.md)
  
  enum: [0,1,2,4]

- `nsfwFlagsExcluded` (query, NSFWFlag, optional)
  Type: NSFWFlag
  
  
  NSFW flags (can be combined using bitwise or operator)
  - `0` NONE
  - `1` VIOLENT
  - `2` EXPLICIT_SEX
  
  
  Schema: [NSFWFlag](https://docs.joinpeertube.org/api-rest-reference/api/models/nsfwflag.md)
  
  enum: [0,1,2,4]

- `aiUsageOneOf` (query, VideoAIUsageSet | Array<VideoAIUsageSet>, optional) - **PeerTube >= 9.0** Only list videos with one of these AI usages, declared by video creators.
If not provided, the preference of the authenticated user (`aiUsagesHidden`) is used

  Type: VideoAIUsageSet | Array<VideoAIUsageSet>
  
  oneOf:
    Reference: [VideoAIUsageSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videoaiusageset.md); Type: VideoAIUsageSet
    
    **PeerTube >= 9.0** Use of AI in the video, declared by the video creator:
      - `1` Not specified
      - `2` No AI-generated content: nothing seen or heard in the video has been generated by AI
      - `3` Contains AI-generated content: some parts of the video have been generated by AI
      - `4` AI-generated: the whole video, or most of it, has been generated by AI
    
    
    enum: [1,2,3,4]
  
    Type: Array<VideoAIUsageSet>
    
    Items:
      Reference: [VideoAIUsageSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videoaiusageset.md); Type: VideoAIUsageSet
      
      **PeerTube >= 9.0** Use of AI in the video, declared by the video creator:
        - `1` Not specified
        - `2` No AI-generated content: nothing seen or heard in the video has been generated by AI
        - `3` Contains AI-generated content: some parts of the video have been generated by AI
        - `4` AI-generated: the whole video, or most of it, has been generated by AI
      
      
      enum: [1,2,3,4]

- `isLive` (query, boolean, optional) - whether or not the video is a live
  Type: boolean

- `includeScheduledLive` (query, boolean, optional) - whether or not include live that are scheduled for later
  Type: boolean

- `categoryOneOf` (query, VideoCategorySet | Array<VideoCategorySet>, optional) - category id of the video (see [/videos/categories](https://docs.joinpeertube.org/api-rest-reference/api/operations/getcategories.html))
  Type: VideoCategorySet | Array<VideoCategorySet>
  
  oneOf:
    Reference: [VideoCategorySet](https://docs.joinpeertube.org/api-rest-reference/api/models/videocategoryset.md); Type: VideoCategorySet
    
    category id of the video (see [/videos/categories](https://docs.joinpeertube.org/api-rest-reference/api/operations/getcategories.html))
    
    Example:
    
    ```json
    15
    ```
  
    Type: Array<VideoCategorySet>
    
    Items:
      Reference: [VideoCategorySet](https://docs.joinpeertube.org/api-rest-reference/api/models/videocategoryset.md); Type: VideoCategorySet
      
      category id of the video (see [/videos/categories](https://docs.joinpeertube.org/api-rest-reference/api/operations/getcategories.html))
      
      Example:
      
      ```json
      15
      ```

- `licenceOneOf` (query, VideoLicenceSet | Array<VideoLicenceSet>, optional) - licence id of the video (see [/videos/licences](https://docs.joinpeertube.org/api-rest-reference/api/operations/getlicences.html))
  Type: VideoLicenceSet | Array<VideoLicenceSet>
  
  oneOf:
    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
    ```
  
    Type: Array<VideoLicenceSet>
    
    Items:
      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
      ```

- `languageOneOf` (query, VideoLanguageSet | Array<VideoLanguageSet>, optional) - language id of the video (see [/videos/languages](https://docs.joinpeertube.org/api-rest-reference/api/operations/getlanguages.html)). Use `_unknown` to filter on videos that don't have a video language
  Type: VideoLanguageSet | Array<VideoLanguageSet>
  
  oneOf:
    Reference: [VideoLanguageSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videolanguageset.md); Type: VideoLanguageSet
    
    language id of the video (see [/videos/languages](https://docs.joinpeertube.org/api-rest-reference/api/operations/getlanguages.html))
    
    Example:
    
    ```json
    "en"
    ```
  
    Type: Array<VideoLanguageSet>
    
    Items:
      Reference: [VideoLanguageSet](https://docs.joinpeertube.org/api-rest-reference/api/models/videolanguageset.md); Type: VideoLanguageSet
      
      language id of the video (see [/videos/languages](https://docs.joinpeertube.org/api-rest-reference/api/operations/getlanguages.html))
      
      Example:
      
      ```json
      "en"
      ```

- `tagsOneOf` (query, string | Array<string>, optional) - tag(s) of the video
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    maxItems: 5
    
    Items:
      Type: string

- `tagsAllOf` (query, string | Array<string>, optional) - tag(s) of the video, where all should be present in the video
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    Items:
      Type: string

- `isLocal` (query, boolean, optional) - **PeerTube >= 4.0** Display only local or remote objects
  Type: boolean

- `include` (query, integer, optional) - **Only administrators and moderators can use this parameter**

Include additional videos in results (can be combined using bitwise or operator)
- `0` NONE
- `1` NOT_PUBLISHED_STATE
- `2` BLACKLISTED
- `4` BLOCKED_OWNER
- `8` FILES
- `16` CAPTIONS
- `32` VIDEO SOURCE

  Type: integer
  
  enum: [0,1,2,4,8,16,32]

- `hasHLSFiles` (query, boolean, optional) - **PeerTube >= 4.0** Display only videos that have HLS files
  Type: boolean

- `hasWebVideoFiles` (query, boolean, optional) - **PeerTube >= 6.0** Display only videos that have Web Video files
  Type: boolean

- `host` (query, string, optional) - Find elements owned by this host
  Type: string

- `autoTagOneOf` (query, string | Array<string>, optional) - **PeerTube >= 6.2** **Admins and moderators only** filter on videos that contain one of these automatic tags
  Type: string | Array<string>
  
  oneOf:
    Type: string
  
    Type: Array<string>
    
    Items:
      Type: string

- `stateOneOf` (query, id | Array<id>, optional) - **PeerTube >= 8.2** **Admins and moderators only** filter on videos that have one of these states
  Type: id | Array<id>
  
  oneOf:
    Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
    
    The video state:
    - `1`: Published
    - `2`: To transcode
    - `3`: To import
    - `4`: Waiting for live stream
    - `5`: Live ended
    - `6`: To move to an external storage (object storage...)
    - `7`: Transcoding failed
    - `8`: Moving to an external storage failed
    - `9`: To edit using studio edition feature
    - `10`: To move to the file system
    - `11`: Moving to the file system failed
    - `12`: Import failed
    - `13`: To duplicate, the files of another video are being copied
    - `14`: Duplication failed, the files of the other video could not be copied
    - `15`: The studio edition of a video saved as a new video failed
    
    
    enum: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
  
    Type: Array<id>
    
    Items:
      Reference: [id](https://docs.joinpeertube.org/api-rest-reference/api/models/id.md); Type: id
      
      The video state:
      - `1`: Published
      - `2`: To transcode
      - `3`: To import
      - `4`: Waiting for live stream
      - `5`: Live ended
      - `6`: To move to an external storage (object storage...)
      - `7`: Transcoding failed
      - `8`: Moving to an external storage failed
      - `9`: To edit using studio edition feature
      - `10`: To move to the file system
      - `11`: Moving to the file system failed
      - `12`: Import failed
      - `13`: To duplicate, the files of another video are being copied
      - `14`: Duplication failed, the files of the other video could not be copied
      - `15`: The studio edition of a video saved as a new video failed
      
      
      enum: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

- `privacyOneOf` (query, VideoPrivacySet, optional) - **PeerTube >= 4.0** Display only videos in this specific privacy/privacies
  Type: VideoPrivacySet
  
  privacy id of the video (see [/videos/privacies](https://docs.joinpeertube.org/api-rest-reference/api/operations/getvideoprivacypolicies.html))
  
  Schema: [VideoPrivacySet](https://docs.joinpeertube.org/api-rest-reference/api/models/videoprivacyset.md)
  
  enum: [1,2,3,4,5]

- `excludeAlreadyWatched` (query, boolean, optional) - Whether or not to exclude videos that are in the user's video history
  Type: boolean

- `search` (query, string, optional) - Plain text search, applied to various parts of the model depending on endpoint
  Type: string

- `includeCollaborations` (query, boolean, optional) - **PeerTube >= 8.0** Include objects from collaborated channels
  Type: boolean

Responses:

- 200: successful operation

Content type: application/json

Type: VideoListResponse

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

- `total` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `data` (optional)
  Type: Array<Video>
  
  maxItems: 100
  
  Items:
    Reference: [Video](https://docs.joinpeertube.org/api-rest-reference/api/models/video.md); Type: Video

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/users/me/videos?count=15&skipCount=false' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/videos?count=15&skipCount=false', {
  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/users/me/videos?count=15&skipCount=false',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Mark feature info as read

`POST /api/v1/users/me/new-feature-info/read`

**PeerTube >= v8.0.0

Authentication (security requirement alternatives):

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

- 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: user

Request body: application/json

Type: object

- `feature` (required)
  Reference: [NewFeatureInfoType](https://docs.joinpeertube.org/api-rest-reference/api/models/newfeatureinfotype.md); Type: NewFeatureInfoType
  
  Represent a new feature that can be displayed to inform users. One of the following values:
  
    - `1` CHANNEL_COLLABORATION
  
  
  enum: [1]

Responses:

- 204: successful operation

## Examples

### cURL

```bash
curl -X POST 'https://peertube2.cpy.re/api/v1/users/me/new-feature-info/read' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "feature": 1
}'
```

### JavaScript

```javascript
const body = `{
  "feature": 1
}`;

const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/new-feature-info/read', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

body = '''{
  "feature": 1
}'''

response = requests.post(
    'https://peertube2.cpy.re/api/v1/users/me/new-feature-info/read',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Update my user avatar

`POST /api/v1/users/me/avatar/pick`

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


Request body: multipart/form-data

Type: object

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

Responses:

- 200: successful operation

Content type: application/json

Type: object

- `avatars` (optional)
  Type: Array<ActorImage>
  
  Items:
    Reference: [ActorImage](https://docs.joinpeertube.org/api-rest-reference/api/models/actorimage.md); Type: ActorImage

- 413: image file too large

## Examples

### cURL

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

### JavaScript

```javascript
const form = new FormData();
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/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/users/me/avatar/pick', headers={"Authorization":"Bearer YOUR_TOKEN"}, files=files)
    print(response.text)
```


## Delete my avatar

`DELETE /api/v1/users/me/avatar`

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


Responses:

- 204: successful operation

## Examples

### cURL

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

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/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/users/me/avatar',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## List my abuses

`GET /api/v1/users/me/abuses`

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:

- `id` (query, integer, optional) - only list the report with this id
  Type: integer

- `state` (query, AbuseStateSet, optional)
  Type: AbuseStateSet
  
  The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)
  
  Schema: [AbuseStateSet](https://docs.joinpeertube.org/api-rest-reference/api/models/abusestateset.md)
  
  enum: [1,2,3]

- `sort` (query, string, optional) - Sort abuses by criteria
  Type: string
  
  enum: ["-id","-createdAt","-state"]

- `start` (query, integer, optional) - Offset used to paginate results
  Type: integer
  
  minimum: 0

- `count` (query, integer, optional) - Number of items to return
  Type: integer
  
  default: 15
  
  minimum: 1
  
  maximum: 100

Responses:

- 200: successful operation

Content type: application/json

Type: object

- `total` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `data` (optional)
  Type: Array<Abuse>
  
  Items:
    Reference: [Abuse](https://docs.joinpeertube.org/api-rest-reference/api/models/abuse.md); Type: Abuse

## Examples

### cURL

```bash
curl -X GET 'https://peertube2.cpy.re/api/v1/users/me/abuses?count=15' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/abuses?count=15', {
  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/users/me/abuses?count=15',
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
