Skip to content

API Reference

All endpoints are under /api/v1. Endpoints require authentication unless the route uses a documented device key or webhook secret flow.

Authentication is resolved from API keys, device keys, or route-specific secrets. Authorization uses permission patterns from config/auth.yaml.

Execution observability

Use GET /workflows/{execution_id}/detail for inspection. Use /pipeline/runs for lightweight live lists and dashboards.

MethodPathDescription
GET/workflowsList executions with optional rule_id, status, and limit filters
GET/workflows/{execution_id}Return raw execution data and pipeline_data_json
GET/workflows/{execution_id}/detailReturn the canonical execution inspector model
POST/workflows/{execution_id}/cancelCancel a running or waiting execution
POST/workflows/{execution_id}/rerunStart a new execution from the original trigger
GET/pipeline/runsList recent runs. status=active returns running and waiting runs
GET/pipeline/runs/{execution_id}Return one lightweight run envelope
GET/pipeline/ingest/activityReturn recent frame and rule-trigger activity
WS/ws/pipelineStream live execution events

Execution detail fields

FieldTypeDescription
idintegerWorkflow execution ID
rule_idintegerRule that ran
statusstringrunning, waiting, completed, failed, or cancelled
started_atdatetime or nullStart time
completed_atdatetime or nullCompletion time
rule_namestringRule display name
trigger_typestringTrigger type from the execution payload
trigger_summarystringServer-computed trigger summary
graphobject or nullImmutable graph snapshot captured at execution start
timelinelistStep timeline, including skipped graph nodes
cooloff_triggeredbooleanWhether the run consumed the rule cool-off window
errorstring or nullExecution error
can_cancelbooleanWhether cancel is available
can_rerunbooleanWhether rerun is available

Pipeline run fields

FieldTypeDescription
execution_idintegerWorkflow execution ID
rule_idintegerRule ID
rule_namestringRule display name
statusstringExecution status
started_atdatetimeStart time
completed_atdatetime or nullCompletion time
errorstring or nullError summary
nodeslistDAG nodes with id, label, step_type, and status
edgeslistDAG edges with source and target handles

Rules

MethodPathDescription
GET/rulesList rules with recent execution counts
POST/rulesCreate a rule
GET/rules/{rule_id}Get a rule with steps, contexts, dependencies, and cron triggers
PUT/rules/{rule_id}Update a rule
DELETE/rules/{rule_id}Delete a rule and related executions
POST/rules/{rule_id}/executeManually trigger a rule
GET/rules/{rule_id}/exportExport a portable rule bundle
POST/rules/import/previewValidate an import bundle
POST/rules/importImport a bundle

Rule fields

FieldTypeDescription
namestringRule name
descriptionstring or nullOptional description
enabledbooleanWhether the rule can run
trigger_typeslist[string]Trigger types: sensor_event, cron, manual, webhook, telegram, occupancy_duration, cts_window, dementia_signal
cron_trigger_idslist[integer]Shared cron schedules linked to the rule
primary_sensor_idstring or nullFallback sensor for context and manual media lookup
cool_off_minutesintegerMinimum time between completed cool-off-worthy runs
max_daily_triggersintegerDaily execution cap
max_concurrent_executionsintegerConcurrent execution cap
execution_timeout_minutesintegerExecution timeout
webhook_configobject or nullWebhook secret and settings
occupancy_configobject or nullOccupancy duration settings
telegram_trigger_configobject or nullTelegram command settings

Pipeline authoring

Pipelines are directed graphs. order is a deterministic tiebreaker, not the runtime sequence.

MethodPathDescription
GET/rules/{rule_id}/stepsList steps
POST/rules/{rule_id}/stepsAdd a step
PUT/rules/{rule_id}/steps/{step_id}Update a step
DELETE/rules/{rule_id}/steps/{step_id}Delete a step
PUT/rules/{rule_id}/steps/positionsBatch update canvas positions
GET/rules/{rule_id}/edgesList graph edges
PUT/rules/{rule_id}/edgesReplace all graph edges atomically
POST/rules/{rule_id}/validateValidate templates and graph structure

Pipeline step fields

FieldTypeDescription
idintegerStep ID
rule_idintegerParent rule ID
orderintegerStable ordering and graph tiebreaker
step_typestringRegistered step type
labelstring or nullSlug label used by template references
config_jsonobjectStep-specific configuration
enabledbooleanWhether the step can run
position_xnumberCanvas x-coordinate
position_ynumberCanvas y-coordinate

Pipeline edge fields

FieldTypeDescription
source_step_idintegerSource step
source_portstringSource output port. Defaults to main
target_step_idintegerTarget step
target_portstringTarget input port. Defaults to main

The validator rejects unknown step IDs, unknown ports, invalid graph structure, and duplicate outgoing edges for the same source port.

Pipeline metadata

MethodPathDescription
GET/pipeline/step-typesRegistered step types with schemas, UI hints, output schemas, tags, and output ports
GET/pipeline/channel-typesRegistered notification channel types
GET/pipeline/filter-typesRegistered context filter types
GET/pipeline/llm-modelsNamed LLM registry entries
GET/pipeline/data-keysTemplate autocomplete variables and step output schemas
POST/pipeline/cron/previewValidate a cron expression and preview next runs

Contexts, dependencies, and cron

MethodPathDescription
GET/rules/{rule_id}/contextsList context filters
POST/rules/{rule_id}/contextsAdd a context filter
DELETE/rules/{rule_id}/contexts/{context_id}Delete a context filter
GET/rules/{rule_id}/dependenciesList dependencies
POST/rules/{rule_id}/dependenciesAdd a dependency
DELETE/rules/{rule_id}/dependencies/{dependency_id}Delete a dependency
GET/cron-triggersList cron triggers
POST/cron-triggersCreate a cron trigger
PUT/cron-triggers/{trigger_id}Update a cron trigger
DELETE/cron-triggers/{trigger_id}Delete a cron trigger

Rooms and sensors

ResourceEndpoints
RoomsGET /rooms, POST /rooms, PUT /rooms/{id}, DELETE /rooms/{id}
SensorsGET /sensors, POST /sensors, PUT /sensors/{id}, DELETE /sensors/{id}
Home Assistant syncPOST /ha/sync/rooms, POST /ha/sync/sensors, GET /ha/entities, GET /ha/media-players

People and presence

MethodPathDescription
GET/personsList household members
POST/personsCreate a member
GET/persons/{person_id}Get member details
PATCH/persons/{person_id}Update a member
DELETE/persons/{person_id}Delete a member
POST/persons/{person_id}/enrollUpload face enrollment photos
GET/persons/{person_id}/enrollmentGet enrollment status
DELETE/persons/{person_id}/enrollmentDelete enrollment
GET/persons/locationsCurrent location envelopes for all tracked members
GET/persons/{person_id}/locationCurrent location envelope for one member
GET/persons/{person_id}/presence-historyPresence history
GET/rooms/{room_id}/occupantsCurrent room occupants
GET/persons/{person_id}/dwellDwell summary

CTS endpoints

CTS routes cover camera admin, calibration, PH identity review, presence, signals, trajectories, live data, overlap groups, and CTS window triggers. They require CTS enablement and the appropriate API permissions.

Representative paths include:

PathPurpose
/cts/camerasCTS camera registration and health
/cts/calibration/*Homography, visibility, privacy zones, and adjacency
/cts/ph/*Person hypothesis lists, details, corrections, merges, splits, and deletes
/cts/presence/*Presence configuration and snapshots
/cts/signals/*Dementia and routine-change signals
/cts/window-triggersCTS window trigger configuration

Knowledge and resident content

ResourceRepresentative endpoints
Knowledge documentsPOST /knowledge, GET /knowledge, GET /knowledge/{doc_id}, PATCH /knowledge/{doc_id}, approval, archive, restore, delete, re-embed
Knowledge imagesPOST /knowledge/{doc_id}/images, PATCH /knowledge/{doc_id}/images/{img_id}, DELETE /knowledge/{doc_id}/images/{img_id}
Info cardsCRUD, approve, archive, restore, suggest, and slot update endpoints under /info-cards
InteractionsGET /knowledge-interactions/queries, /quiz-sessions, and /info-card-deliveries

Webhooks

MethodPathDescription
POST/webhooks/{rule_id}Trigger a rule with the configured webhook secret
POST/webhooks/{rule_id}/generate-secretGenerate or rotate the rule webhook secret

Webhook requests use X-Webhook-Secret. The JSON body is available to the pipeline as trigger_input.

Errors

StatusMeaning
400Invalid operation for the resource state
401Missing or invalid authentication
403Authenticated key lacks permission
404Resource not found
409Conflict, such as a duplicate rule name or step label
422Validation error, including template or graph validation failures
503Required service unavailable

Released under the AGPL-3.0 License.