API Documentation

WorkOrder Systems OSS aims to be the Linux of maintenance software: a production-grade, self-hostable core you can deploy and extend without vendor lock-in. This site documents the Supabase-backed public API—reads through views, writes through RPCs—wrapped by @workorder-systems/sdk for tenants, work orders, assets, labor, reporting, and the rest of the domain. The project vision and adoption notes live in docs/PROJECT.md.

Getting started

  1. Copy your project URL and anon key from the dashboardProject Settings → API.
  2. Install @workorder-systems/sdk and @supabase/supabase-js, then call createDbClient(url, anonKey).
  3. Sign users in with Supabase Auth. For tenant-scoped data, set tenant context and refresh the session so the JWT includes tenant_id.

Guides

Quickstart

Install the SDK, create a client, and make your first requests.

Read more

Installation

Package name, peer dependency, and usage in browser, Node, and edge.

Read more

Authentication

Sign in with Supabase Auth; the SDK uses the same session.

Read more

Tenant context

Set and clear tenant context for multi-tenant operations.

Read more

Tenant API keys

Machine auth per tenant; SDK management and automated meter ingest.

Read more

Authorization (RBAC & ABAC)

Roles, permissions, scopes, and how RPCs enforce access.

Read more

Errors

SdkError and common PostgREST/Supabase error codes.

Read more

Capability inventory

Vendors as contractors, warranties, docs metadata, tools, handover — what exists vs gaps.

Read more

How to build a plugin

Checklist: catalog, Vault, install, webhooks, subscriptions, and local verification.

Read more

Building plugins

Architecture and deep reference for plugins, HMAC, and the public API surface.

Read more

Resources

Tenants & organization

Tenants

List tenants, create tenants, invite users, assign roles.

Departments

List, create, update, and delete departments.

Labor

Technicians, crews, skills, certifications, shifts, assignments.

Catalogs

Statuses, priorities, maintenance types, and workflow graph.

Capability inventory

Vendors as contractors, warranties, docs metadata, tools, handover.

Tenant API keys

Machine-scoped keys; create, list, revoke; meter ingest Edge Function.

Work orders & dispatch

Work orders

List, create, transition, complete, log time; attachments and metadata.

Request portal and SLA

Submit requests, SLA rules, acknowledgment, breach views.

Scheduling & dispatch

Schedule blocks, assign work orders, validate and unschedule.

Mobile field

Offline sync, start/stop work order, notes, attachments; mobile views.

Field operations

Tool checkouts, returns, shift handover logbook.

Places & assets

Locations

List, create, update, delete; hierarchy and site rollups.

Map zones

GeoJSON shapes on the map; list, create, update, delete.

Spaces

List, create, update, delete spaces by location.

Assets

List, create, update, and delete assets.

Asset downtime

Downtime events for availability metrics and reporting.

Maintenance & meters

Meters

List meters and readings; create, update, record, delete.

PM (preventive maintenance)

Templates, schedules; due, overdue, upcoming, and history.

Reporting & compliance

Dashboard

Metrics, MTTR, open/overdue work orders, and summaries.

Analytics reporting

Dimensions, facts, KPIs; BI and warehouse contract.

Costs & lifecycle

Work order, asset, location costs; lifecycle alerts and TCO.

Projects

Read-only list/get; link work orders for project cost roll-up.

Notifications

In-app feed, mark read, and per-event preferences (typed Supabase client).

Audit

Entity and permission change logs; retention config.

Safety & compliance

Inspections, runs, incidents, corrective actions, reporting.

Inventory & plugins

Parts & inventory

Parts, stock, suppliers, reservations, POs, requisitions.

How to build a plugin

End-to-end checklist from catalog registration to first webhook delivery.

Plugins

Catalog and tenant installations; install, update, uninstall.

Was this page helpful?