Release a locker compartment via API
Parcel lockers and mailroom matrices release one compartment at a time when a recipient or courier is authorized. In OpenApp each compartment is modeled as a switchable entity — the same switchable.open action used for doors and gates.
This guide is for campus mail services, corporate mailrooms, and parcel-wall operators automating pickup. See Model by sector (locker / parcel matrix).
- One integration + devices represent the locker bank (or one device per compartment).
- Each compartment is an entity with a human-readable name in metadata.
- Your app validates a pickup code, then calls
switchable.openon that entity only.
Release one compartment
Section titled “Release one compartment”export OPENAPP_API_BASE='https://api.openapp.house/api/v1'export OPENAPP_API_KEY='v1_openapp_YOUR_SECRET'export OPENAPP_ORG_ID='01HORG00000000000000000000'export COMPARTMENT_ENTITY_ID='01HENTITY000000000000000000'
curl -sS -X POST \ -H "Authorization: Bearer ${OPENAPP_API_KEY}" \ -H "Content-Type: application/json" \ -H "X-Org: ${OPENAPP_ORG_ID}" \ -d '{}' \ "${OPENAPP_API_BASE}/entities/${COMPARTMENT_ENTITY_ID}/actions/switchable.open"Python (SDK)
Section titled “Python (SDK)”await client.entities.by_id(compartment_entity_id).open()Discover compartment entities
Section titled “Discover compartment entities”curl -sS \ -H "Authorization: Bearer ${OPENAPP_API_KEY}" \ -H "X-Org: ${OPENAPP_ORG_ID}" \ "${OPENAPP_API_BASE}/integrations/${INTEGRATION_ID}/entities?limit=100&offset=0"Map external ids (compartment numbers) to entity ids during provisioning — provision a building with scripting for bulk setup.
Safety
Section titled “Safety”- Never open by numeric guess — resolve entity id from your parcel system’s authoritative mapping.
- Rate-limit automated release endpoints exposed to couriers.
- Log compartment id + correlation id for support (audit activity).