58 lines
1014 B
Markdown
58 lines
1014 B
Markdown
# Playlists API
|
|
|
|
Base path: `/api/v1/playlists`
|
|
|
|
All endpoints require `Authorization: Bearer <jwt>`.
|
|
|
|
Related: [[02 - Videos API]], [[04 - Database Schema]], [[10 - Quota API]]
|
|
|
|
---
|
|
|
|
## GET /playlists/channel/:channelId
|
|
|
|
List all playlists for a given channel.
|
|
|
|
**Response:** `Playlist[]`
|
|
|
|
---
|
|
|
|
## GET /playlists/video/:videoId
|
|
|
|
List all playlists that a specific video belongs to.
|
|
|
|
**Response:** `Playlist[]`
|
|
|
|
---
|
|
|
|
## POST /playlists/channel/:channelId/sync
|
|
|
|
Sync playlists from YouTube for the given channel, creating or updating local records to match the YouTube source.
|
|
|
|
**Response:**
|
|
|
|
```json
|
|
{ "synced": number }
|
|
```
|
|
|
|
**Cost:** Consumes YouTube API quota. See [[10 - Quota API]].
|
|
|
|
---
|
|
|
|
## POST /playlists/video/:videoId/:playlistId
|
|
|
|
Add a video to a playlist. Creates a `VideoPlaylist` join record.
|
|
|
|
**Response:** `VideoPlaylist`
|
|
|
|
---
|
|
|
|
## DELETE /playlists/video/:videoId/:playlistId
|
|
|
|
Remove a video from a playlist. Deletes the `VideoPlaylist` join record.
|
|
|
|
**Response:**
|
|
|
|
```json
|
|
{ "removed": true }
|
|
```
|