Files
bookhoard/docs/developer/api/libraries/add_library_folder.md
T
John O'Keefe 8aa66a30fc docs(api): sync mirrors with the retired rules CRUD and the chain-order endpoint
Three mirrors had drifted:

- The rules-endpoint retirement (4f71eda6) deleted the routes but not
  their mirrors: removed docs/developer/api/collections/
  {add_auto_assign_rule,remove_auto_assign_rule,test_rule,update_rule}
  .md + their bruno twins, and pruned /api/collections/test-rules,
  /{id}/rules, /{id}/rules/{ruleId} from the generated openapi spec
  (hand-edited — regenerating with -update would wipe hand-authored
  bruno suites that predate the docs mirrors).
- New endpoint PUT /api/collections/:id/view-settings gets a doc page
  + schema-registry entry + bruno mirror (repo convention: the route
  and its docs land together).
- 54 pre-existing TestDocsMatchRoutes failures: the media-item
  endpoints emit the 16 episode/download fields (source_feed_id,
  feed_position, download_state, enclosure_url, hosts/guests, …) and
  libraries emit purpose/allow_member_feeds, but the doc examples
  were never extended — the package only runs on the host, so the
  container suite never caught it. Examples now carry every key the
  handlers emit; internal/docs is fully green.
2026-10-31 15:40:21 -04:00

57 lines
1.2 KiB
Markdown

---
method: POST
path: /api/libraries/:id/folders
auth: jwt+admin
area: libraries
---
<!-- source: internal/handlers/library.go:167 LibraryHandler.AddLibraryFolder -->
# 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 example-request
{
"folder_path": "/path/to/comics"
}
```
## Response (201 Created)
```json example-response
{
"id": "uuid",
"library_id": "uuid",
"folder_path": "/path/to/comics",
"created_at": "2026-01-31T10:00:00Z",
"purpose": "scan"
}
```
## Error Responses
| Code | Description |
| ---- | ------------------------ |
| 400 | Invalid folder path |
| 401 | Invalid or expired token |
| 403 | User is not an admin |
| 404 | Library not found |