API Reference v1
RoomLoop REST API
A clean, predictable JSON API. All endpoints are HTTPS-only and require a bearer token. Rate limits apply per token.
Base URL
https://api.roomloop.dev
Auth
Bearer + Google SSO
Webhooks
Signed HMAC-SHA256
POST
/v1/auth/googleExchange Google OAuth ID token for a RoomLoop session.
Authentication
POST
/v1/auth/logoutRevoke the current session.
Authentication
GET
/v1/facilitiesList all facilities. Supports ?type, ?building, ?status filters.
Facilities
GET
/v1/facilities/:idRetrieve a single facility with amenities and capacity.
Facilities
GET
/v1/facilities/:id/availabilitySlot-by-slot availability for a date. Pass ?date=YYYY-MM-DD.
Facilities
PATCH
/v1/facilities/:idUpdate facility metadata. Admin only.
Facilities
POST
/v1/reservationsCreate a reservation. Runs the rules engine.
Reservations
GET
/v1/reservationsList reservations. ?user_id, ?facility_id, ?from, ?to.
Reservations
PATCH
/v1/reservations/:idUpdate purpose or status (confirm / cancel).
Reservations
DELETE
/v1/reservations/:idPermanently delete a reservation. Admin only.
Reservations
GET
/v1/accountsList teacher accounts. ?department, ?role.
Accounts
POST
/v1/accountsProvision a single account.
Accounts
POST
/v1/accounts/bulkCSV bulk upload. multipart/form-data with `file` field.
Accounts
GET
/v1/accounts/exportDownload all teacher accounts as CSV.
Accounts
GET
/v1/reports/usageUsage aggregates. ?from, ?to, ?facility_id, ?user_id.
Reports
GET
/v1/reports/export.csvStream a CSV export of reservations in a range.
Reports
GET
/v1/reports/export.xlsxStream an Excel export of reservations in a range.
Reports
POST
/v1/webhooksRegister a webhook for reservation.* and account.* events.
Webhooks
Example — create reservation
The booking endpoint returns the canonical resource with rules-engine outcome embedded.
POST /v1/reservations
Authorization: Bearer sk_live_•••••••••••••••
Content-Type: application/json
{
"facility_id": "f1",
"date": "2026-06-10",
"start_slot": 2,
"end_slot": 3,
"purpose": "Grade 10 Chemistry — titration lab"
}
// 201 Created
{
"id": "res_8f3e21",
"status": "confirmed",
"facility": { "id": "f1", "name": "STEM Lab Alpha" },
"date": "2026-06-10",
"slots": ["10:00–10:50", "11:00–11:50"],
"created_at": "2026-06-08T09:14:00Z"
}Errors
Standard HTTP status codes plus a structured body.
400validation_error
Body failed schema validation.
401unauthorized
Missing or expired bearer token.
403forbidden
Role lacks the required capability.
409slot_conflict
Rules engine R-03: another booking occupies the slot.
422rule_violation
Rules engine refused the request. Includes failing rule code.
429rate_limited
Per-token rate limit exceeded.