Skip to content

Admin endpoints

All require admin auth (Bearer BEDS24_WEBHOOK_SECRET OR Basic auth challenge — paste the secret as the password). Source: src/lib/webhook-auth.tsverifyAdminAuth.

Read views (HTML)

PathDescription
GET /admin/clean-statusCleaning state per upcoming booking; ?past=1 for full history
GET /admin/email-statusMailgun event timeline; ?msg=X or ?booking=X filters
GET /admin/delivery-statusCross-channel send log; ?booking=X filter
GET /admin/property/{id}Visual editor for property_config fields
GET /admin/property/{id}/rawRaw-JSON textarea fallback for property_config
GET /admin/booking/{id}Raw Beds24 booking + thread message dump

Mutation endpoints

PathMethodDescription
POST /admin/backfillPOSTSpawn DailyFlagSyncWorkflow with horizonDays=365
POST /admin/property/{id}/form-overridesPOSTSave raw JSON form_overrides
POST /admin/property/{id}/toggle-omitPOSTFlip omit flag on one form field
POST /admin/booking/{id}/respawnPOSTForce ensureBookingFlagWorkflow respawn
POST /admin/booking/{id}/allow-auto-action?value=all|disable|defaultPOSTSet BA’s allowAutoAction on a booking
POST /admin/sms-test?to=+1...&body=...POSTFire a one-shot diagnostic SMS via Twilio

Add-on action endpoints (M4c)

PathMethodDescription
GET /admin/booking/{id}/addon-capture?addon=early_checkin|late_checkoutGETBill clicks → capture payment intent + notify guest
GET /admin/booking/{id}/addon-decline?addon=...&reason=...GETBill clicks → cancel auth + apologize

GET (not POST) so the URL in the workflow’s email works directly in a browser tab.

Auth shape

The auth header can be either:

  • Authorization: Bearer {secret} — programmatic calls (curl, scripts)
  • Authorization: Basic {b64(:secret)} — browser dialog if no header

If auth fails, response is 401 with WWW-Authenticate: Basic realm="..." header to trigger the browser dialog.

Source

  • src/routes/admin.ts — all routes
  • Wired in src/index.ts via url.pathname.startsWith("/admin/")