Roasting
Roast profile routes
Create, import, analyze, and clear roast profiles through session-authenticated internal endpoints.
Roast routes cover CRUD for roast profiles, Artisan import, chart telemetry, chart display settings, data clearing, and AI-assisted classification.
All roast routes require an authenticated session. The AI classifier additionally requires the member role.
Endpoints
| Route | Methods | Auth | Purpose |
|---|---|---|---|
| /api/roast-profiles | GET POST PUT DELETE | Session | List, create, update, or delete roast profiles |
| /api/artisan-import | POST | Session | Import an Artisan roast file into an existing roast profile |
| /api/roast-chart-data | GET | Session | Return sampled roast telemetry and metadata for a roast |
| /api/roast-chart-settings | GET | Session | Read saved chart ranges for a roast |
| /api/clear-roast | DELETE | Session + ownership | Clear imported roast telemetry and reset Artisan fields |
| /api/ai/classify-roast | POST | Session + member role | Classify a roast against inventory candidates using the model backend |
Key behaviors
- POST /api/roast-profiles supports both single and batch creation and recalculates stocked status for each affected inventory record.
- PUT /api/roast-profiles requires an id query parameter. DELETE accepts either id or batch name query parameters.
- POST /api/artisan-import expects multipart form-data with file and roastId. Supported file extensions are .alog, .alog.json, and .json.
- GET /api/roast-chart-data requires roastId and returns sampled telemetry tuned for charting, including performance metadata and derived ranges.
- DELETE /api/clear-roast requires roast_id and verifies ownership before deleting imported telemetry, events, and log rows.
- POST /api/ai/classify-roast expects alogMetadata plus an inventory array and returns { match } or { match: null }.
CLI access
The CLI is the cleanest supported interface for roast workflows outside the browser, especially for imports and automated watch-folder flows.
Import an Artisan file
purvey roast import roast.alog --coffee-id 42 --batch-name "Guji test batch" --pretty