GetMyHotels Favorites API
The favorites API from GetMyHotels — 2 operation(s) for favorites.
The favorites API from GetMyHotels — 2 operation(s) for favorites.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/getmyhotels-com:getmyhotels-com-favorites-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: GetMyHotels REST Favorites API
version: 1.0.0
description: REST surface for the native GetMyHotels apps. Every route is a thin transport over the shared tRPC routers — inputs are validated with the same Zod schemas the web client uses, and responses are returned verbatim. Authentication uses Better Auth bearer session tokens issued by the /api/auth/* endpoints (not part of this spec). Native clients send X-GMH-App-Version and X-GMH-Platform on every request; versions below the configured floor receive a typed 426 UpgradeRequiredError.
servers:
- url: https://api.getmyhotels.com
description: Production API
tags:
- name: Favorites
paths:
/v1/favorites:
get:
tags:
- Favorites
summary: List my favorites
description: 'Runs `user.listFavorites` for one `entityType` (default `hotel`), newest first, one entry per hotel. Returns `{ entityIds, items }`: `items` are `{ entityType, entityId, hotelKey, ref, name, imageUrl, city, country, starRating }` where `entityId` equals `hotelKey` for a supplier hotel. `ref` is freshly minted on every response and opens `GET /v1/hotels/{ref}`; it is null when the row cannot mint one. The display fields are the snapshot the client sent when it saved the row, and are null for rows saved before snapshots existed (render a placeholder; never fail). Each item also has `savedAt`. `entityIds` lists the same entries'' ids, in order.'
security:
- bearerAuth: []
parameters:
- schema:
type: string
enum:
- hotel
- flight
- car
default: hotel
required: false
name: entityType
in: query
responses:
'200':
description: Success
content:
application/json:
schema:
description: Verbatim JSON output of the `user.listFavorites` tRPC procedure. Response shapes are intentionally not modeled in this spec; the native client types them by hand.
'400':
description: Request validation failed or the router rejected the input
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing or invalid bearer session token
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'426':
description: Reported X-GMH-App-Version is below the supported minimum — the app must update
content:
application/json:
schema:
$ref: '#/components/schemas/UpgradeRequiredError'
'500':
description: Unexpected server error (opaque; details stay in logs)
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
operationId: getV1Favorites
x-operation-id-source: derived
post:
tags:
- Favorites
summary: Favorite a hotel
description: 'Runs `user.setFavorite` with `favorited: true`. Send the hotel''s `hotelKey` (`hk_…`, from search or detail) as `entityId`, plus its `ref` and the display fields `name`, `imageUrl` (https or site-relative), `city`, `country`, `starRating` (0-5) so the list can open and render the hotel on any device. A `ref` naming a different hotel than `entityId` is a 400. An `sh_` ref sent as `entityId` is accepted and filed under its hotel key. Idempotent: favoriting something already favorited leaves one entry and refreshes its snapshot (unlike the web toggle). Returns `{ favorited: true, entityId }`, `entityId` being the key the entry is stored under.'
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
entityType:
type: string
enum:
- hotel
- flight
- car
entityId:
type: string
minLength: 1
maxLength: 255
ref:
type:
- string
- 'null'
minLength: 1
maxLength: 255
name:
type:
- string
- 'null'
minLength: 1
maxLength: 255
imageUrl:
type:
- string
- 'null'
maxLength: 2048
city:
type:
- string
- 'null'
maxLength: 255
country:
type:
- string
- 'null'
maxLength: 100
starRating:
type:
- number
- 'null'
minimum: 0
maximum: 5
note:
type: string
maxLength: 500
required:
- entityType
- entityId
responses:
'200':
description: Success
content:
application/json:
schema:
description: Verbatim JSON output of the `user.setFavorite` tRPC procedure. Response shapes are intentionally not modeled in this spec; the native client types them by hand.
'400':
description: Request validation failed or the router rejected the input
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing or invalid bearer session token
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'426':
description: Reported X-GMH-App-Version is below the supported minimum — the app must update
content:
application/json:
schema:
$ref: '#/components/schemas/UpgradeRequiredError'
'500':
description: Unexpected server error (opaque; details stay in logs)
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
operationId: postV1Favorites
x-operation-id-source: derived
delete:
tags:
- Favorites
summary: Unfavorite a hotel
description: 'Runs `user.setFavorite` with `favorited: false`. `entityId` is the `hotelKey` (or an `sh_` ref of the same hotel); this also removes entries saved under a ref before hotel keys existed. Idempotent: removing something that is not a favorite succeeds. Returns `{ favorited: false, entityId }`.'
security:
- bearerAuth: []
parameters:
- schema:
type: string
enum:
- hotel
- flight
- car
required: true
name: entityType
in: query
- schema:
type: string
minLength: 1
maxLength: 255
required: true
name: entityId
in: query
responses:
'200':
description: Success
content:
application/json:
schema:
description: Verbatim JSON output of the `user.setFavorite` tRPC procedure. Response shapes are intentionally not modeled in this spec; the native client types them by hand.
'400':
description: Request validation failed or the router rejected the input
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing or invalid bearer session token
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'426':
description: Reported X-GMH-App-Version is below the supported minimum — the app must update
content:
application/json:
schema:
$ref: '#/components/schemas/UpgradeRequiredError'
'500':
description: Unexpected server error (opaque; details stay in logs)
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
operationId: deleteV1Favorites
x-operation-id-source: derived
/v1/recent-views:
get:
tags:
- Favorites
summary: List what I viewed recently
description: 'Runs `user.getRecentlyViewed`, newest first, one entry per hotel, from the last 50 views; filter with `entityType`. Returns `{ items }`: each is `{ entityType, entityId, hotelKey, ref, name, imageUrl, city, country, starRating }` where `entityId` equals `hotelKey` for a supplier hotel. `ref` is freshly minted on every response and opens `GET /v1/hotels/{ref}`; it is null when the row cannot mint one. The display fields are the snapshot the client sent when it saved the row, and are null for rows saved before snapshots existed (render a placeholder; never fail). Each item also has `viewedAt`.'
security:
- bearerAuth: []
parameters:
- schema:
type: string
enum:
- hotel
- flight
- car
required: false
name: entityType
in: query
- schema:
type: integer
minimum: 1
maximum: 50
default: 20
example: 20
required: false
name: limit
in: query
responses:
'200':
description: Success
content:
application/json:
schema:
description: Verbatim JSON output of the `user.getRecentlyViewed` tRPC procedure. Response shapes are intentionally not modeled in this spec; the native client types them by hand.
'400':
description: Request validation failed or the router rejected the input
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing or invalid bearer session token
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'426':
description: Reported X-GMH-App-Version is below the supported minimum — the app must update
content:
application/json:
schema:
$ref: '#/components/schemas/UpgradeRequiredError'
'500':
description: Unexpected server error (opaque; details stay in logs)
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
operationId: getV1RecentViews
x-operation-id-source: derived
post:
tags:
- Favorites
summary: Record a view
description: 'Runs `user.trackView`. Call when the customer opens a hotel. Send the hotel''s `hotelKey` (`hk_…`, from search or detail) as `entityId`, plus its `ref` and the display fields `name`, `imageUrl` (https or site-relative), `city`, `country`, `starRating` (0-5) so the list can open and render the hotel on any device. A `ref` naming a different hotel than `entityId` is a 400. An `sh_` ref sent as `entityId` is accepted and filed under its hotel key. A repeat view of the same hotel moves it to the top and refreshes its snapshot instead of adding an entry. Returns `{ success: true }`. Best-effort on the client: a failure here must never block the screen.'
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
entityType:
type: string
enum:
- hotel
- flight
- car
entityId:
type: string
minLength: 1
maxLength: 255
ref:
type:
- string
- 'null'
minLength: 1
maxLength: 255
name:
type:
- string
- 'null'
minLength: 1
maxLength: 255
imageUrl:
type:
- string
- 'null'
maxLength: 2048
city:
type:
- string
- 'null'
maxLength: 255
country:
type:
- string
- 'null'
maxLength: 100
starRating:
type:
- number
- 'null'
minimum: 0
maximum: 5
required:
- entityType
- entityId
responses:
'200':
description: Success
content:
application/json:
schema:
description: Verbatim JSON output of the `user.trackView` tRPC procedure. Response shapes are intentionally not modeled in this spec; the native client types them by hand.
'400':
description: Request validation failed or the router rejected the input
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Missing or invalid bearer session token
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'426':
description: Reported X-GMH-App-Version is below the supported minimum — the app must update
content:
application/json:
schema:
$ref: '#/components/schemas/UpgradeRequiredError'
'500':
description: Unexpected server error (opaque; details stay in logs)
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
operationId: postV1RecentViews
x-operation-id-source: derived
components:
schemas:
UpgradeRequiredError:
type: object
properties:
error:
type: object
properties:
code:
type: string
enum:
- UPGRADE_REQUIRED
message:
type: string
minVersion:
type: string
example: 1.2.0
platform:
type:
- string
- 'null'
required:
- code
- message
- minVersion
- platform
required:
- error
ApiError:
type: object
properties:
error:
type: object
properties:
code:
type: string
example: NOT_FOUND
message:
type: string
example: Booking not found
domainCode:
type: string
example: NON_REFUNDABLE_CONSENT_REQUIRED
issues:
type: array
items:
type: object
properties:
path:
type: string
message:
type: string
required:
- path
- message
required:
- code
- message
required:
- error
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Better Auth session token. Obtain it from the native /api/auth/* endpoints (Better Auth bearer plugin — out of scope for this spec, see #922).'
x-provenance:
method: harvested
publisher: GetMyHotels
source: https://api.getmyhotels.com/v1/openapi.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)