Lotwarden

REST API

One small message per event.

JSON over HTTPS. Reads are open in this prototype; writes need an API token in the Authorization: Bearer header (administrators and operators).

GET /api/lots

Every lot with its occupancy.

curl https://lotwarden.prototype.sbarron.com/api/lots

GET /api/lots/{slug}/occupancy

Free, occupied and held counts for one lot, right now.

curl https://lotwarden.prototype.sbarron.com/api/lots/riverside-garage/occupancy
{
  "lot": "riverside-garage", "total": 72, "free": 26, "occupied": 46, "reserved": 0, "percent": 64
}

POST /api/lpr/events

A plate read from an entry or exit camera. An entry takes a free space and opens a visit; an exit closes the visit and frees the space.

curl -X POST https://lotwarden.prototype.sbarron.com/api/lpr/events \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"lot_id":1,"plate":"KTW4821","direction":"in","camera":"Entry lane","confidence":0.97}'
# 201 {"visit_id":812,"space":"1B-07","summary":"KTW4821 entered Riverside Garage → 1B-07"}
# 401 {"message":"A valid API token is required."}

POST /api/sensors/events

A bay sensor reporting a car or no car.

curl -X POST https://lotwarden.prototype.sbarron.com/api/sensors/events -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{"space_id":14,"occupied":true}'

GET /api/citations/{number}

One citation and its payment status.

curl https://lotwarden.prototype.sbarron.com/api/citations/C-123456