pinakes/docs/api/playlists.md
NotAShelf 9e5eb41d39
nix: set up project-wide formatter
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4806c58aa0a17f504c9312723ad770166a6a6964
2026-03-22 23:58:28 +03:00

228 lines
4.4 KiB
Markdown
Vendored

# 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 |
---