Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Id0d1f9769b7ccdbf83d5fa78adef62e46a6a6964
229 lines
3.9 KiB
Markdown
229 lines
3.9 KiB
Markdown
# Playlists
|
|
|
|
Media playlists
|
|
|
|
## Endpoints
|
|
|
|
### GET /api/v1/playlists
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | List of playlists |
|
|
| 401 | Unauthorized |
|
|
| 500 | Internal server error |
|
|
|
|
---
|
|
|
|
### POST /api/v1/playlists
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Request Body
|
|
|
|
`Content-Type: application/json`
|
|
|
|
See `docs/api/openapi.json` for the full schema.
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Playlist created |
|
|
| 400 | Bad request |
|
|
| 401 | Unauthorized |
|
|
| 500 | Internal server error |
|
|
|
|
---
|
|
|
|
### GET /api/v1/playlists/{id}
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Playlist details |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|
|
### PATCH /api/v1/playlists/{id}
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
|
|
#### Request Body
|
|
|
|
`Content-Type: application/json`
|
|
|
|
See `docs/api/openapi.json` for the full schema.
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Playlist updated |
|
|
| 400 | Bad request |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|
|
### DELETE /api/v1/playlists/{id}
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Playlist deleted |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|
|
### GET /api/v1/playlists/{id}/items
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Playlist items |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|
|
### POST /api/v1/playlists/{id}/items
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
|
|
#### Request Body
|
|
|
|
`Content-Type: application/json`
|
|
|
|
See `docs/api/openapi.json` for the full schema.
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Item added |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|
|
### PATCH /api/v1/playlists/{id}/items/reorder
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
|
|
#### Request Body
|
|
|
|
`Content-Type: application/json`
|
|
|
|
See `docs/api/openapi.json` for the full schema.
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Item reordered |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|
|
### DELETE /api/v1/playlists/{id}/items/{media_id}
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
| `media_id` | path | Yes | Media item ID |
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Item removed |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|
|
### POST /api/v1/playlists/{id}/shuffle
|
|
|
|
**Authentication:** Required (Bearer JWT)
|
|
|
|
#### Parameters
|
|
|
|
| Name | In | Required | Description |
|
|
|------|----|----------|-------------|
|
|
| `id` | path | Yes | Playlist ID |
|
|
|
|
#### Responses
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 200 | Shuffled playlist items |
|
|
| 401 | Unauthorized |
|
|
| 403 | Forbidden |
|
|
| 404 | Not found |
|
|
|
|
---
|
|
|