---
title: "Favorite a hotel"
method: POST
path: "/v1/favorites"
tags: ["favorites"]
---

# Favorite a hotel

`POST /v1/favorites`

## Request

- Base URL: `https://api.getmyhotels.com`
- URL: `https://api.getmyhotels.com/v1/favorites`
- Auth: HTTP bearer

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.

## Request body

- object
  - `entityType` 'hotel' | 'flight' | 'car', required
  - `entityId` string, required
  - `ref` string, nullable
  - `name` string, nullable
  - `imageUrl` string, nullable
  - `city` string, nullable
  - `country` string, nullable
  - `starRating` number, nullable
  - `note` string

## Response `200`

Success

- unknown

## Other responses

- `400`: Request validation failed or the router rejected the input
- `401`: Missing or invalid bearer session token
- `426`: Reported X-GMH-App-Version is below the supported minimum — the app must update
- `500`: Unexpected server error (opaque; details stay in logs)

---

[API](https://skmtc.dev/getmyhotels/apis/getmyhotels-rest-api.md) · [All operations](https://skmtc.dev/getmyhotels/apis/getmyhotels-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getmyhotels/apis/getmyhotels-rest-api/revisions/cba24a9c13f0?raw)
