API Reference
REST API & WebSocket
All endpoints are served from a single Axum server on port 7624. REST for commands, WebSocket for real-time events.
HTTP: http://localhost:7624/api/v1 WS: ws://localhost:7624/ws
Authentication
Local access (default): no authentication required. For remote access, pass the token in the Authorization header.
Authorization: Bearer <token> # Token saved in ~/.config/openskylab/config.toml
Mount
/mount/statusCurrent RA/DEC, Alt/Az, tracking mode, slewing state, pier side, time to flip
/mount/gotobody: { ra, dec }Slew to J2000 coordinates (ra in hours, dec in degrees)
/mount/syncbody: { ra, dec }Sync mount position to solved coordinates
/mount/parkPark the mount at configured park position
/mount/unparkUnpark and resume tracking
/mount/trackingbody: { mode: "sidereal"|"lunar"|"solar"|"off" }Set tracking mode
/mount/abortEmergency stop all mount movement
/mount/alignmentList alignment points in the pointing model
/mount/alignment/addbody: AlignPointAdd a solved alignment point
/mount/alignment/clearClear all alignment points
Camera
/camera/statusSensor info, cooler status, current exposure progress
/camera/exposebody: ExposureParamsStart an exposure (duration, gain, offset, binning, frame type)
/camera/abortAbort current exposure
/camera/frame/latestDownload the most recent captured frame
/camera/coolerbody: { enabled, target_c }Set cooler on/off and target temperature
/camera/livestack/startStart live stacking incoming frames
/camera/livestack/stopStop live stacking
/camera/livestack/resetClear accumulated stack
/camera/livestackCurrent live stack status and preview
Focuser
/focuser/statusPosition, temperature, moving state, max position
/focuser/movebody: { position }Move to absolute position (steps)
/focuser/move-relbody: { steps }Move relative (positive = out, negative = in)
/focuser/autofocusStart V-curve autofocus routine
Guiding (PHD2)
/guiding/statusGuide state, RMS RA/DEC, star position, calibration state
/guiding/startStart autoguiding (connects to PHD2)
/guiding/stopStop autoguiding
/guiding/ditherbody: { pixels, settle_time }Dither by N pixels, wait for settle
Sequencer
/sequencesList all saved sequences
/sequencesbody: SequenceCreate a new sequence
/sequences/{id}Get sequence by ID
/sequences/{id}Delete a sequence
/sequencer/statusCurrent state, step, frame, elapsed time, ETA
/sequencer/startbody: { sequence_id }Start running a sequence
/sequencer/pausePause after current exposure
/sequencer/resumeResume paused sequence
/sequencer/abortAbort and discard remaining
/sequencer/checkpointGet recovery checkpoint (for crash resume)
Scheduler
/scheduler/plansList observation plans
/scheduler/plansbody: SchedulerPlanCreate a multi-target plan
/scheduler/statusScheduler state, current target, progress
/scheduler/startStart automated observation
/scheduler/pausePause scheduler
/scheduler/resumeResume scheduler
/scheduler/abortAbort and park
/scheduler/skip-targetSkip current target, move to next
Plate Solver
/solver/solvebody: { image_path, ra_hint?, dec_hint? }Solve a FITS image. Uses ASTAP, falls back to astrometry.net
/solver/result/{id}Get solve result (RA, DEC, position angle, pixel scale)
/solver/indexesList available ASTAP and astrometry.net databases
/solver/download-indexbody: { database }Download a solver database
More Endpoints
Additional endpoint groups include: filter wheel, rotator, flat panel, dome, weather, safety, catalog, mosaic, profiles, templates, cloud sync, publish (OpenSkyLab Cloud image/acquisition upload), dew heater, switches, sky flat, storage, session, advanced sequencer, GNSS, blink comparator, distortion analysis, sub-exposure calculator, HiPS tiles, calibration library, polar alignment, telemetry, license, ASCOM bridge, and logs. See the OpenAPI 3.1 spec for the complete reference.
WebSocket Events
Connect to ws://localhost:7624/ws for real-time events. All events follow this shape:
interface WsEvent {
type: string; // e.g. "mount.status"
ts: number; // Unix milliseconds
data: unknown; // type-specific payload
}Event Types
| Event | Frequency | Description |
|---|---|---|
| mount.status | 10Hz / 1Hz | Position, tracking state (fast when slewing) |
| camera.frame_ready | On complete | Frame downloaded and saved |
| camera.expose_progress | 1Hz | Exposure progress percentage |
| focuser.status | On change | Position, moving state, temperature |
| guiding.stats_update | 1Hz | RA/DEC RMS, corrections |
| guiding.state_changed | On change | Guiding, Paused, Lost, Calibrating |
| sequencer.step_changed | On change | New step/filter/target started |
| sequencer.frame_saved | Per frame | Frame saved with HFR, star count |
| solver.result | On solve | Solve result with coordinates |
| solver.download_progress | On progress | Solver index download: database, name, downloaded/total MB, percent |
| solver.download_complete | On complete | Solver index download finished |
| solver.download_error | On error | Solver index download failed |
| catalog.download_progress | On progress | Catalog database download progress |
| catalog.download_complete | On complete | Catalog database download finished |
| catalog.download_error | On error | Catalog database download failed |
| ascom_bridge.started | On start | COM→Alpaca bridge process started: port, pid |
| ascom_bridge.stopped | On stop | COM→Alpaca bridge process stopped |
| device.connected | On connect | Device connected event |
| device.disconnected | On disconnect | Device disconnected event |
| weather.update | 60s | Weather conditions |
| session.started | On start | Imaging session started |
| session.ended | On end | Imaging session ended |
| scheduler.state_changed | On change | Scheduler engine state transition |
| scheduler.target_started | On change | New observation target |
| scheduler.target_completed | On complete | Current target finished |
| scheduler.target_skipped | On skip | Target skipped, moved to next |
| scheduler.plan_completed | On complete | Entire multi-target plan finished |
| scheduler.meridian_flip_started | On start | Automated meridian flip beginning |
| scheduler.meridian_flip_completed | On complete | Automated meridian flip succeeded |
| scheduler.meridian_flip_failed | On error | Automated meridian flip failed |
| scheduler.safety_alert | On event | Weather unsafe, stopping |
| scheduler.error | On error | Scheduler encountered an error |
| dome.status | On change | Shutter state, azimuth, parked state |
| dome.shutter_changed | On change | Shutter state transition |
| dome.rotating | On event | Dome azimuth rotation in progress |
| dome.parking | On event | Dome parking in progress |
| cloud.sync_complete | On complete | WebDAV cloud sync finished |
| polar_alignment.state_changed | On change | Polar alignment routine state transition |
| polar_alignment.error_computed | On compute | Alt/Az error in arcmin |
| hips.predownload_progress | On progress | HiPS sky-cache pre-download progress |
| hips.predownload_complete | On complete | HiPS sky-cache pre-download finished |
| sky_flat.state_changed | On change | Twilight sky flat automation state transition |
| sky_flat.exposure_done | Per frame | Sky flat exposure captured |
| alert | On event | info, warning, error, critical |
