Skip to main content
GET
This is an optional server-sent events (SSE) companion to Get Room Options. Start a room request first, then connect to the returned data.sse_stream_url to receive supplier results progressively.

Connect to the Stream

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

Each event includes the stream_id, hotel_id, timestamp, and event_type. A provider_options event contains options with the booking_token required for prebook.

Stream Lifetime

Treat stream_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

x-api-key
string
header
required

Environment-specific API key created in the Unifystays portal

Headers

Last-Event-ID
string

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"

X-Unifystays-Contract-Version
enum<string>
default:1

Hotel API contract version. Missing defaults to v1.

Available options:
1

Path Parameters

hotel_id
string
required

Unifystays hotel ID used to start the room search.

Example:

"123456"

stream_id
string
required

Room stream ID returned by POST /hotels/{hotel_id}/rooms.

Example:

"stream_8f4b9d1f6d9e"

Response

Room stream not found, expired, or belongs to another hotel.