---
title: "Update a rank"
method: PATCH
path: "/datainsights/v1.1/favorites/{id}"
tags: ["Favorites"]
---

# Update a rank

`PATCH /datainsights/v1.1/favorites/{id}`

Update the rank of a favorite. If there is already a favorite in the new position, it will be
updated with the current rank, swapping the position

**Notes**
- There is not possible to have 2 ranks with the same value could not be duplicated.
- The maximum numbers of reports to favorite is 12.
- Example: If you want to update a favorite to the rank 1, being your favorite in the position 2. The rank in the
position 1 will be moved to the 2 and the 2 to the 1

## Path parameters

- `id` integer, required

## Headers

- `X-PROPERTY-ID` integer, required

## Request body

- Rank
  - `rank` integer, required — Rank associated to the favorite in order to display the reports

## Response `200`

OK

- Favorite
  - `id` integer, required — Favorite Id
  - `rank` integer, required — Rank associated to the favorite in order to display the reports
  - `report_id` integer — Report, Stock Report or Hub Id favorited
  - `entity_id` integer — Report, Stock Report or Hub Id favorited
  - `report_kind` 'report' | 'stock_report' | 'hub' — Report Kind
  - `kind` 'report' | 'stock_report' | 'hub' — Favorite Kind

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/cloudbeds/apis/cloudbeds-api.md) · [All operations](https://skmtc.net/cloudbeds/apis/cloudbeds-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cloudbeds/cloudbeds-api/revisions/2faa857793e8/schema)
