Files
bookhoard/docs/developer/api/devices/update_device_mapping.md
T
John O'Keefe c4b62af213 docs(devices): Work Order 3 batch 1 — 6 missing device endpoints + gate entries
New frontmatter'd docs with handler-compatible examples:
- devices/get_device.md (DeviceInfo shape)
- devices/regenerate_device_token.md (token + sync_urls)
- devices/get_device_mappings.md (wrapper + DeviceMappingSummary)
- devices/update_device_mapping.md (UpdateDeviceMappingRequest)
- devices/download_sidecar_config.md (sidecar config JSON file)
- devices/link_book.md (LinkBookRequest; one UNVERIFIED marker on required-tag)

Schema registry: 6 new entries; DeviceMappingSummary hoisted to package
scope. Gate passes (the UNVERIFIED marker is logged, not a failure).

Excludes /api/devices-page (htmx page route, per ground rules).
2026-10-24 14:46:22 -04:00

48 lines
1.2 KiB
Markdown

---
method: PUT
path: /api/devices/:id/collections/:collectionId
auth: jwt
area: devices
---
<!-- source: internal/handlers/collections.go:724 CollectionHandler.UpdateDeviceMapping -->
# Update Device Collection Mapping
Updates a device shelf-to-collection mapping's shelf name and sync direction.
## Example request
```json example-request
{
"device_shelf_name": "Kobo",
"sync_direction": "bidirectional"
}
```
## Example response
```json example-response
{
"id": "660e8400-e29b-41d4-a716-446655440000",
"collection_id": "770e8400-e29b-41d4-a716-446655440000",
"device_id": "550e8400-e29b-41d4-a716-446655440000",
"device_shelf_name": "Kobo",
"sync_direction": "bidirectional",
"created_at": "2026-10-24 13:57:01.81234 +0000 UTC"
}
```
## Request fields
| Field | Type | Required | Notes |
| ----- | ---- | -------- | ----- |
| device_shelf_name | string | yes | |
| sync_direction | string | yes | one of `bidirectional`, `book_to_device`, `device_to_book`, `none` |
## Errors
| Status | Body | When |
| ------ | ---- | ---- |
| 400 | `{"error": "invalid mapping id"}` / `{"error": "invalid request"}` | malformed id or body |
| 500 | `{"error": "..."}` | unexpected server error |