# Get video embed privacy

`GET /api/v1/videos/{id}/embed-privacy`

**PeerTube >= 8.1**

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:

- `id` (path, id | UUIDv4 | shortUUID, required) - The object id, uuid or short uuid
  Type: id | UUIDv4 | shortUUID
  
  oneOf:
    Reference: [id](https://sourcey-peertube.pages.dev/api-rest-reference/models/id.md); Type: id
    
    minimum: 1
    
    Example:
    
    ```json
    42
    ```
  
    Reference: [UUIDv4](https://sourcey-peertube.pages.dev/api-rest-reference/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://sourcey-peertube.pages.dev/api-rest-reference/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: object

- `policy` (optional)
  Type: object
  
  - `id` (optional)
    Reference: [VideoEmbedPrivacy](https://sourcey-peertube.pages.dev/api-rest-reference/models/videoembedprivacy.md); Type: VideoEmbedPrivacy
    
    The video embed privacy level:
      - `1` All allowed: anyone can embed the video
      - `2` Allowlist: only the domains in the allowlist can embed the video
      - `3` Remote restrictions: the remote instance has restrictions on where the video can be embedded
      - `4` Nobody can embed this video
    
    
    enum: [1,2,3,4]
  
  - `label` (optional)
    Type: string
    
    Example:
    
    ```json
    "Allowlist"
    ```

- `domains` (optional)
  Type: Array<string>
  
  Items:
    Type: string
    
    Example:
    
    ```json
    "example.com"
    ```

- 400: invalid request

## Examples

### cURL

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

### JavaScript

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