HTS APIs
Every endpoint, schema and error code, rendered from the published OpenAPI files, in the order you integrate them.
/api/lodging_content/v1/catalogCatalogGet catalog of lodging changes
Retrieve a catalog of lodging IDs that have been added, updated, or delisted since a given timestamp.
This endpoint supports pagination through two request types:
Initial Request:
- Specify a starting timestamp (
after), event type (event_type), and page size - Returns the first page of lodging IDs matching the criteria
- If more results are available, the response includes a
next_cursor - The
total_resultsfield indicates the total number of lodgings at the time of the initial request
Follow-up Request:
- Use the
cursorfrom a previous response (send the value ofnext_cursor) to fetch the next page - Continue making follow-up requests until
next_cursoris null/empty - Each response returns the next batch of lodging IDs
Data Consistency Guarantees
Live Data and Concurrent Changes:
The catalog endpoint returns a live view of lodging changes, which has important implications for data consistency:
Changes During Pagination: While you are paginating through results for a specific
event_type, lodgings may undergo changes (added, updated, or delisted) in real-time. If a lodging experiences a change that matches your query criteria during the pagination process, it will be automatically appended to the result set and returned in subsequent pages.Dynamic Total Count: The
total_resultsvalue from the initial response represents the count at that moment. As new matching changes occur during pagination, the actual number of results returned across all pages may exceed this initial count. Always continue paginating untilnext_cursoris null rather than relying ontotal_resultsto determine when to stop.
Consistency and Replay Guarantees:
The catalog endpoint provides the following guarantees for reliable change tracking:
Completeness Guarantee: You will never miss a change. Any lodging that experienced a matching change at or after your
aftertimestamp will eventually be returned, even if the change occurred while you were paginating through results.Monotonic Consistency: Using the same
aftertimestamp in multiple requests will always return at least the same set of changes. If new changes occurred between requests, the result set will grow to include them. This allows safe replay without data loss.Safe Retries and Catch-Up: If you need to restart your synchronization process from a specific timestamp, you can safely reuse the same
aftervalue. This ensures complete change coverage without gaps. Implement deduplication in your client to handle lodgings that may appear in multiple synchronization runs.Ordering Guarantee: Changes are always returned in ascending order by their change timestamp, ensuring predictable and consistent ordering across all pagination sessions and replay attempts.
Complete Change Synchronization
IMPORTANT: To obtain a complete snapshot of all catalog changes since a given timestamp, you must poll all three event types separately.
Required Polling Cycles:
The catalog endpoint filters changes by a single event_type per request. To retrieve all changes that occurred
after your after timestamp, you must perform three independent polling cycles:
Poll for Added Lodgings:
- Set
event_type=addedand your desiredaftertimestamp - Paginate through all pages until
next_cursoris null - Collect all lodging IDs that were newly added to the catalog
- Set
Poll for Updated Lodgings:
- Set
event_type=updatedand the sameaftertimestamp - Paginate through all pages until
next_cursoris null - Collect all lodging IDs that had content or metadata updates
- Set
Poll for Delisted Lodgings:
- Set
event_type=delistedand the sameaftertimestamp - Paginate through all pages until
next_cursoris null - Collect all lodging IDs that were removed from the catalog
- Set
Synchronization Pattern:
timestamp = get_last_sync_timestamp()
// Poll all three event types with the same timestamp
added_response = poll_all_pages(after=timestamp, event_type="added")
updated_response = poll_all_pages(after=timestamp, event_type="updated")
delisted_response = poll_all_pages(after=timestamp, event_type="delisted")
// Now you have a complete snapshot of all changes
apply_changes(added_response.lodging_ids, updated_response.lodging_ids, delisted_response.lodging_ids)
// Use next_after from any of the responses for your next sync cycle
// All three responses will have the same or very similar next_after values
save_last_sync_timestamp(added_response.next_after)
Understanding next_after vs next_cursor:
next_cursor: Used for pagination within a single poll cycle for one event type. When present, make another request with this token as thecursorto get the next page of results for the same event type. Continue untilnext_cursoris null.next_after: Indicates the timestamp to use for your next synchronization cycle across all event types. This field is always present in every response. After completing pagination for all three event types (added, updated, delisted), use thenext_aftervalue from the final page as your newaftertimestamp for the next complete synchronization cycle.
Only after completing all three event type polls will you have a complete and accurate view of all catalog changes
that occurred since your after timestamp.
Integration Best Practices
Persistence: Always persist the
next_aftertimestamp from your last completed synchronization cycle. This ensures you can resume from the correct point if your synchronization process is interrupted.Event Type Processing: You can execute the three event type polls (added, updated, delisted) either in parallel or sequentially. While uncommon, a single lodging may appear in multiple event types if it underwent multiple state changes during the polling window (e.g., a lodging could be added, then updated, then delisted). This is an edge case but possible. Sequential processing (added → updated → delisted) may be preferable if maintaining temporal ordering is important for your application. Parallel execution can minimize synchronization time if you plan to fetch the latest content for each lodging ID regardless of the event type order.
Continuation Point: After completing all pagination for all three event types, use the
next_aftervalue from any of the final responses as youraftertimestamp for the next synchronization cycle.Deduplication: Implement deduplication logic in your client to handle lodgings that may appear in multiple event types within the same synchronization cycle, or in multiple synchronization runs due to concurrent changes occurring during pagination.
Monitoring: Monitor the difference between
total_resultsand actual results received to detect high-velocity change periods that may require more frequent synchronization.
Request body application/json · required
Catalog query criteria - either initial selection with timestamp and filters, or follow-up selection with cursor
type:initial (catalog_request_initial) catalog_request_initial
request_idUnique value used to identify this request. If provided to us during operational questions, it will help us provide better support.
123e4567-e89b-12d3-a456-426614174000typeDiscriminator value for initial catalog request
initial · Example initialafterReturn catalog changes that occurred after this timestamp (ISO 8601 format)
2025-01-01T00:00:00Zevent_typeType of catalog event for filtering lodging changes
addedupdateddelisted · Example addedpage_sizeNumber of results per page
10follow_up (catalog_request_follow_up) catalog_request_follow_up
request_idUnique value used to identify this request. If provided to us during operational questions, it will help us provide better support.
123e4567-e89b-12d3-a456-426614174000typeDiscriminator for follow-up selection
follow_up · Example follow_upcursorThe opaque pagination token from the previous CatalogResponse (next_cursor).
eyJvZmZzZXQiOjIwfQ==Responses
200List of lodging IDs matching the catalog criteria
lodging_idsList of lodging IDs matching the catalog criteria
total_resultsTotal number of results available across all pages
150has_moreIndicates whether more results are available beyond the current page within the same poll cycle.
truenext_afterTimestamp to use as the 'after' parameter for the next synchronization cycle. This represents the continuation point after completing the current poll cycle. When pagination is complete (next_cursor is null), use this value for your next polling cycle to avoid gaps in change tracking. If no results were returned, this will match the 'after' timestamp from your request.
2025-01-15T10:30:00Zresponse_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000next_cursorOpaque token for retrieving the next page of results. Include this as cursor in a follow-up request to continue pagination within the same poll cycle.
If null or omitted, no further results are available for this cycle.
eyJvZmZzZXQiOjIwfQ==400Invalid Request. There will be an error code in the response detailing the issue.
error_codeError code for catalog operation failures
invalid_requestinternal_errorunauthorizeddescriptionHuman-readable description of the error
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "invalid_request",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}500Internal server error
error_codeError returned when an internal server error occurs.
internal_server_errordescriptionA human-readable description of the error.
response_idUnique identifier of the specific response. Use this identifier when you need to refer to a specific response, when requiring technical support.
123e4567-e89b-12d3-a456-426614174000Example
{
"error_code": "internal_server_error",
"description": "string",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}curl -X PUT "https://travel-distribution.staging.htsapis.com/api/lodging_content/v1/catalog" \
-H "HTS-API-KEY: $HTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "123e4567-e89b-12d3-a456-426614174000",
"type": "initial",
"after": "2025-01-01T00:00:00Z",
"event_type": "added",
"page_size": 10
}'{
"lodging_ids": [
"123e4567-e89b-12d3-a456-426614174000"
],
"total_results": 150,
"has_more": true,
"next_cursor": "eyJvZmZzZXQiOjIwfQ==",
"next_after": "2025-01-15T10:30:00Z",
"response_id": "123e4567-e89b-12d3-a456-426614174000"
}Examples are generated from the schema where the spec publishes none; field values are illustrative.
