curl -N "$UNIFYSTAYS_BASE_URL/hotels/123456/rooms/stream/stream_8f4b9d1f6d9e" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "language: en"
Search & hotels
Stream Room Updates
Consume server-sent room option events as active suppliers return availability for a hotel.
GET
/
hotels
/
{hotel_id}
/
rooms
/
stream
/
{stream_id}
curl -N "$UNIFYSTAYS_BASE_URL/hotels/123456/rooms/stream/stream_8f4b9d1f6d9e" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "language: en"
This is an optional server-sent events (SSE) companion to
Get Room Options. Start a room request first,
then connect to the returned
Each event includes the
data.sse_stream_url to receive supplier results
progressively.
Connect to the Stream
curl -N "$UNIFYSTAYS_BASE_URL/hotels/123456/rooms/stream/stream_8f4b9d1f6d9e" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "language: en"
The stream requires
x-api-key. Connect from your backend or proxy the
stream through your backend; do not place an API key in browser code or a URL.Event Flow
| Event | Meaning | Client action |
|---|---|---|
stream_ready | The stream was created. | Record the stream state if needed. |
provider_options | One supplier returned normalized room options. | Add the options to the selected hotel’s room list. |
provider_skipped | A supplier cannot provide streamed room options. | Continue with options from other suppliers. |
provider_error | One supplier’s room request failed. | Continue with other results and show a recoverable state if no options arrive. |
done | All supplier requests settled or the stream expired. | Close the client connection and stop waiting for updates. |
stream_id, hotel_id, timestamp, and event_type.
A provider_options event contains options with the booking_token required
for prebook.
Stream Lifetime
Treatstream_id as short-lived and single-use. If the stream is missing or
expired, call Get Room Options again to create a
new stream. The standard room response remains the source for the selected
stay’s request context.
The OpenAPI section below documents the required path parameters and request
headers.Authorizations
Environment-specific API key created in the Unifystays portal
Headers
Optional SSE resume cursor. Omit it (or use 0) for the first connection. When reconnecting, send the ID of the last event successfully processed. If that event is no longer retained, the API returns ROOM_STREAM_REPLAY_GAP and a new room search is required.
Example:
"17"
Hotel API contract version. Missing defaults to v1.
Available options:
1 Path Parameters
Unifystays hotel ID used to start the room search.
Example:
"123456"
Room stream ID returned by POST /hotels/{hotel_id}/rooms.
Example:
"stream_8f4b9d1f6d9e"
Response
Room stream not found, expired, or belongs to another hotel.