API reference

Skiff Public API v1

Base URL https://binranoynwqpydttvgbs.supabase.co/functions/v1/public-api. Every request carries Authorization: Bearer sk_live_…. All data is scoped to the key owner's account. The machine-readable contract is at /openapi.yaml.

GET/v1/vesselsread:vessel

List the account's vessels with health score and engine hours.

GET/v1/vessels/{id}read:vessel

One vessel.

GET/v1/vessels/{id}/dueread:vessel

Maintenance due feed: per-task status ok | due_soon | overdue with due_date and due_hours.

Anchored on the last matching service entry, or the task baseline before any service.

GET/v1/vessels/{id}/logbookread:vessel

Service entries and engine-hour logs, newest first (200 each).

GET/v1/vessels/{id}/inspectionsread:vessel

Inspection history for a vessel (last 50).

GET/v1/inspections/{id}read:vessel

One inspection with its items and verdicts (operational | attention | non_operational).

POST/v1/vessels/{id}/service-logwrite:log

Create a service entry.

Body: title (required), done_at, engine_hours, cost, currency, route ('diy' | 'supplier'), note, task_id. Returns 201.

POST/v1/vessels/{id}/hourswrite:log

Log engine hours and update the vessel meter.

Body: hours (required, must not be below the current meter), litres, fuel_cost, currency, logged_at. Returns 201.

Errors

401 {"error":"invalid_key"}       key missing, malformed, or revoked
403 {"error":"missing_scope"}     key lacks the required scope
404 {"error":"not_found"}         unknown route or a vessel you do not own
422 {"error":"hours_below_current"} hours may not go backwards
429 {"error":"rate_limited"}      over 60 requests/minute
503 {"error":"api_disabled"}      the API is switched off platform-wide

Auditability

Every write made with a key lands in the owner's audit trail, attributed to the owner, exactly like a write from the app.