Public API integration
Use versioned HTTP endpoints to list rooms, read availability with nightly pricing, and create bookings from your website. Authenticate with an API key you create under each property's Integrations page.
Base URL
All public routes share this prefix. Replace YOUR_PROPERTY_ID with the property’s id from the dashboard.
https://app.staymod.in/api/public/v1/properties/{propertyId}/...Authentication
Send the secret key as a Bearer token. Create keys in Integrations and select the scopes you need.
Header: Authorization: Bearer <api_key>
| Scope | Allows |
|---|---|
| * | All public endpoints below. |
| rooms:read | List rooms for a property. |
| availability:read | Room availability and nightly prices. |
| bookings:write | Create bookings. |
Origin and IP rules
Optional restrictions configured per key in Integrations.
- Allowed origins — If set, browser requests must send a matching
Originheader. Requests without Origin (typical server-to-server) are still allowed. - Allowed IPs — If set, the client IP (first entry in
X-Forwarded-For) must match.
GET — List rooms
Scope: rooms:read. Returns active rooms with serialized tags and images.
curl -s \
-H "Authorization: Bearer YOUR_API_KEY" \
"https://app.staymod.in/api/public/v1/properties/YOUR_PROPERTY_ID/rooms"GET — Room availability
Scope: availability:read. Query params from and to are YYYY-MM-DD (UTC). Defaults: from today, through 29 nights ahead. Maximum range: 62 nights.
curl -s \
-H "Authorization: Bearer YOUR_API_KEY" \
"https://app.staymod.in/api/public/v1/properties/YOUR_PROPERTY_ID/room-availability?from=2026-04-01&to=2026-04-14"POST — Create booking
Scope: bookings:write. Body matches internal booking creation: guest fields, ISO checkIn/checkOut, and a rooms array with roomId (MongoDB id string) and quantity. Optional roomNumbers must match configured numbers on that room.
curl -s -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"guestName": "Jane Guest",
"guestEmail": "jane@example.com",
"checkIn": "2026-05-01T14:00:00.000Z",
"checkOut": "2026-05-04T11:00:00.000Z",
"numberOfGuests": 2,
"rooms": [
{ "roomId": "ROOM_OBJECT_ID", "quantity": 1 }
]
}' \
"https://app.staymod.in/api/public/v1/properties/YOUR_PROPERTY_ID/bookings"Managing API keys
Keys are created per property and organization.
Open a property, then choose Integrations in the sidebar (/[propertyId]/integrations). Pick scopes and optionally restrict origins or IPs. The raw secret is shown only once when the key is created.