API reference

HTS APIs

Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.

PUT/api/lodging/v1/notifications/eventsEvents

Retrieve a list of notification events.

https://travel-distribution.staging.htsapis.com/api/lodging/v1/notifications/events

Retrieves a filtered and paginated list of notification events related to bookings. Events capture state changes in reservations and bookings. Each event has both an event_timestamp (when it occurred) and a write_timestamp (when it was stored). Events are returned in chronological order (oldest first) by write_timestamp.

Consumption Guarantees

Events are ordered and paginated by storage write time in chronological order (oldest first), which provides a critical guarantee: once you retrieve events for a time period, that period is immutable. New events will never be inserted into already-retrieved time ranges.

This means:

  • After fetching events from a specific write_timestamp, any future events will have write timestamps at or after the last event you retrieved
  • You never need to re-fetch the same time period to check for late-arriving events
  • Polling strategies can safely track the last seen write_timestamp and only request newer events

Why Storage Write Time Matters

Using storage write time for ordering guarantees that time periods are immutable once retrieved. After you fetch events for a given time range, you can be certain no new events will appear in that range on future requests. This eliminates the need to re-poll historical periods and prevents missed events in polling-based integrations.

Typical Polling Pattern

  1. Initial fetch: Make a request with desired filters and page_size (or specify an after timestamp for a starting point)
  2. Paginate through results: If next_cursor is present in the response, use it in the next request to fetch the next page
  3. Continue until complete: Repeat step 2 until next_cursor is absent (all events retrieved up to that point)
  4. Track latest timestamp: For ongoing polling, track the latest write_timestamp from the last response
  5. Poll for new events: Use the tracked timestamp in the after field to fetch only new events

This pattern ensures you never miss events and never fetch duplicates.

Request body application/json · required

Event type filters, pagination (after timestamp or cursor), and page size.

event_types
array of event_type
required

List of event types to include in results. When empty, all event types are returned. Multiple types are combined with OR logic (returns events matching ANY of the specified types).

pagination
event_pagination · one of 2
required

Pagination mode (mutually exclusive options)

Show fields

Pagination mode (mutually exclusive options)

Exactly one of the following:
event_pagination_after event_pagination_after
after
string · date-time
required

ISO 8601 timestamp; return events written after this time (chronological order)

event_pagination_cursor event_pagination_cursor
cursor
string
required

Opaque pagination token from the previous response's next_cursor

page_size
integer · int32

Number of events per page

Range ≥ 1, ≤ 100

Responses

200List of notification events for the requested criteria. The `events` array may be empty if no events match the criteria or if all events have been retrieved.
events
array of event
required

List of notification events. May be empty if no events match the criteria or if all events have been retrieved.

Show fields
Array of event · one of 2 · List of notification events. May be empty if no events match the criteria or if all events have been retrieved.
Exactly one of the following, selected by type:
reservation_cancelled (reservation_cancelled_event) reservation_cancelled_event
type
string enum
required

Type of the event.

Values reservation_cancelled
reservation_transaction_appended (reservation_transaction_appended_event) reservation_transaction_appended_event
type
string enum
required

Type of the event.

Values reservation_transaction_appended
transaction_id
string
required

Transaction identifier for the newly appended transaction.

next_cursor
string

Opaque cursor for fetching the next page of events. When present, more events are available - use this value in the next request's pagination.cursor field. When absent, no more events are available. Do not attempt to parse or modify this value.

400Invalid request parameters: - `page_size` out of range (must be 1-100) - Malformed `cursor` value - Invalid `event_types` values
error_code
string enum
required

Error codes for the events operation. This is a non-exhaustive list of enum values, which will be extended in the future.

Values invalid_inputunauthorized
description
string
required

A human-readable description of the error.

Example
{
  "error_code": "invalid_input",
  "description": "string"
}
500Internal server error
error_code
string enum
required

Error returned when an internal server error occurs.

Values internal_server_error
description
string
required

A human-readable description of the error.

response_id
string · uuid
required

Unique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.

Example 123e4567-e89b-12d3-a456-426614174000
Example
{
  "error_code": "internal_server_error",
  "description": "string",
  "response_id": "123e4567-e89b-12d3-a456-426614174000"
}
Request
curl -X PUT "https://travel-distribution.staging.htsapis.com/api/lodging/v1/notifications/events" \
  -H "HTS-API-KEY: $HTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "event_types": [],
  "pagination": {
    "after": "2025-01-01T00:00:00Z"
  },
  "page_size": 2
}'
Response 200
{
  "events": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "event_timestamp": "2025-10-08T14:30:00Z",
      "write_timestamp": "2025-10-08T14:30:05Z",
      "order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "type": "reservation_cancelled"
    },
    {
      "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
      "event_timestamp": "2025-10-08T15:45:00Z",
      "write_timestamp": "2025-10-08T15:45:02Z",
      "order_id": "3f5e7c3a-9b2c-4d1e-8f4a-5b6c7d8e9f0a",
      "type": "reservation_transaction_appended",
      "transaction_id": "9f8e7d6c-5b4a-3c2d-1e0f-1a2b3c4d5e6f"
    }
  ],
  "next_cursor": "eyJsYXN0X3RpbWVzdGFtcCI6IjIwMjUtMTAtMDhUMTU6NDU6MDIuMDAwWiJ9"
}

Examples come from the spec.