Phase 2 part 3: Split library and media item endpoints - Libraries: get_visible_libraries, get_library, create_library, add_library_folder, set_library_visibility - Media Items: list_media_items, get_media_item, search_media_items, filter_sort_media_items, update_media_item, delete_media_item - Complete request/response examples for all endpoints
52 lines
1013 B
Markdown
52 lines
1013 B
Markdown
# Add Library Folder
|
|
|
|
Add a folder to an existing library (Admin only).
|
|
|
|
**Endpoint**: `POST /api/libraries/{library_id}/folders`
|
|
**Auth**: Required (Admin only)
|
|
**Content-Type**: `application/json`
|
|
|
|
## Path Parameters
|
|
|
|
| Parameter | Type | Required | Description |
|
|
|-----------|------|-----------|-------------|
|
|
| library_id | string | Yes | Library UUID |
|
|
|
|
## Request Body
|
|
|
|
| Field | Type | Required | Description |
|
|
|--------|------|-----------|-------------|
|
|
| folder_path | string | Yes | Absolute path to folder |
|
|
|
|
### Example Request
|
|
|
|
```json
|
|
{
|
|
"folder_path": "/path/to/comics"
|
|
}
|
|
```
|
|
|
|
## Response (201 Created)
|
|
|
|
```json
|
|
{
|
|
"id": "uuid",
|
|
"library_id": "uuid",
|
|
"folder_path": "/path/to/comics",
|
|
"created_at": "2026-01-31T10:00:00Z"
|
|
}
|
|
```
|
|
|
|
## Error Responses
|
|
|
|
| Code | Description |
|
|
|------|-------------|
|
|
| 400 | Invalid folder path |
|
|
| 401 | Invalid or expired token |
|
|
| 403 | User is not an admin |
|
|
| 404 | Library not found |
|
|
|
|
## Try It Out
|
|
|
|
<!-- API Explorer will be inserted here in Phase 3 -->
|