Skip to content
OAOpenAppPhysical Security as a Service
Login

Provision a building with OpenApp Scripting

Multi-site rollouts (campus wings, new apartment towers, demo environments) repeat the same steps: integrations, devices, entities, portals. OpenApp Scripting runs Rhai programs server-side via POST /scripting/execute — ideal for one-shot provisioning jobs and CI pipelines.

This guide is for platform engineers automating building setup. Syntax reference: OpenApp Scripting. Getting started: Scripting step.

  • API key with scripting execute permission in at least one org
  • A tested script in the interactive shell or a .openapp file

Scripting does not take X-Org on the wire; org context is resolved from caller permissions inside the runtime.

Terminal window
export OPENAPP_API_BASE='https://api.openapp.house/api/v1'
export OPENAPP_API_KEY='v1_openapp_YOUR_SECRET'
curl -sS -X POST \
-H "Authorization: Bearer ${OPENAPP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"script": "print(\"provision batch start\");"
}' \
"${OPENAPP_API_BASE}/scripting/execute"

Replace the script body with your provisioning program (create integration, devices, entities — see reference for built-ins).

import os
from openapp_sdk import AsyncClient
client = AsyncClient(os.environ["OPENAPP_API_KEY"])
result = await client.scripting.execute(
script='entity_action("01HENTITY...", "switchable.open", #{});'
)
print(result)

Or load a file:

result = await client.scripting.execute_file("provision-wing-a.openapp")
// Illustrative — adapt to your org and provider types (see scripting reference).
let integration_id = create_integration("virtual_access", #{ "name": "Tower A" });
// create devices, entities, portals...

Keep scripts idempotent where possible (check before create) and run against a staging org first.

Use scriptingUse SDK / HTTP directly
Many chained steps in one atomic jobSingle invite or door action
CI template copied per buildingPMS webhook on each check-in
Operator-maintained .openapp filesProduction microservice

← Release locker compartment · go2rtc door camera →