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).
43 lines
1.2 KiB
Markdown
43 lines
1.2 KiB
Markdown
---
|
|
method: GET
|
|
path: /api/devices/:id/sidecar/download
|
|
auth: jwt
|
|
area: devices
|
|
---
|
|
<!-- source: internal/handlers/sidecar.go:215 SidecarHandler.DownloadSidecarConfig -->
|
|
|
|
# Download Sidecar Config
|
|
|
|
Generates and downloads a `.bookhoard.json` sidecar configuration file for a
|
|
device (used by the sidecar sync workflow). The body is a JSON document returned
|
|
with `Content-Disposition: attachment`.
|
|
|
|
## Example response
|
|
|
|
```json example-response
|
|
{
|
|
"version": "1.0",
|
|
"bookhoard": {
|
|
"opds_catalog": "http://localhost:8765/opds/devices/550e8400-.../catalog",
|
|
"sync_api": "http://localhost:8765/api/sync/kobo",
|
|
"opds_base_url": "http://localhost:8765/opds",
|
|
"api_base_url": "http://localhost:8765/api",
|
|
"device_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"device_token": "dev_abc123..."
|
|
},
|
|
"books": {},
|
|
"collections": [],
|
|
"opds_enabled": true,
|
|
"sidecar_enabled": true,
|
|
"last_updated": "2026-10-24T13:57:01Z"
|
|
}
|
|
```
|
|
|
|
## Errors
|
|
|
|
| Status | Body | When |
|
|
| ------ | ---- | ---- |
|
|
| 400 | `{"error": "invalid device ID"}` | malformed id |
|
|
| 404 | `{"error": "device not found"}` | no such device |
|
|
| 500 | `{"error": "failed to fetch media items"}` / `{"error": "failed to generate config"}` | unexpected server error |
|