Skip to content

REST API

Opening a door

This guide is for integrations that open a door on somebody’s behalf, for example a booking system that offers a remote opening or a front desk tool. The integration acts for a person, and only if that person could open the door themselves.

  • The token needs interaction_requests:write, and interaction_requests:read to read the result.
  • The entrance must allow opening through the API. Its openable_via_api field says whether it does.
  • You need the id of the person you act for: an account, a site membership (site staff) or a tenant membership (tenant user).
  1. Send POST /interaction_requests with the door and the person. Name the door with exactly one of entrance_id or unit_id; for a unit, sedisto uses the unit’s entrance. Name the person with exactly one of account_id, site_membership_id or tenant_membership_id. A site_membership_id also confines the request to that membership.

    {
    "entrance_id": "5b1d6c2e-3a4f-4e8a-9c1d-0a1b2c3d4e03",
    "tenant_membership_id": "9a0e…",
    "interaction": "unlock"
    }
  2. Choose the operation with interaction: unlock, lock, open or close. Without it, sedisto uses unlock.

  3. Read the response. It is the new interaction request with its id and state.

sedisto checks the request exactly as it checks a request from the person’s own app: an active rental agreement or membership, inside its access period, inside opening hours, at an entrance that may be opened through the API. The permission lets you act for somebody; it does not let you exceed what they may do.

Status Meaning
404 The person or the door cannot be found within your integration’s reach. A removed membership, a tenant membership outside its period and a blocked account count as not found.
422 The person exists but has no valid access right at this door right now, or no person was named.
401 The token is missing or invalid.
403 The token lacks interaction_requests:write.

If your POST /interaction_requests gets no answer, for example because the connection dropped, assume that the door may already have opened. Whether it did depends on how far the request got. Do not send the same request again blindly.

  1. Look for the request first: GET /interaction_requests filtered by the entrance and a requested_at shortly before your attempt, for example q[entrance_id_eq]=<id>&q[requested_at_gteq]=<time>.
  2. If you find it, follow its state as below instead of opening again.
  3. Only if there is none, and the person still wants the door opened, send a new request.

A created request is not yet an open door. The hardware reports back, and the request moves from requested to in_progress and then to completed or failed.

  • Webhooks: subscribe to interaction_request.in_progress, interaction_request.completed and interaction_request.failed. Each carries the request id, state, interaction and the timestamps. A successful opening also produces an access.granted event, delivered separately and possibly earlier or later. See Receiving webhooks.
  • Polling: GET /interaction_requests/{id} returns the current state with requested_at, completed_at or failed_at.

GET /interaction_requests lists all door interactions at the sites your integration may see, newest first. It is the audit trail of openings and grows without bound, so filter it, for example with q[state_eq]=failed. See Filtering, searching and sorting.