---
title: "Favorite or unfavorite a file"
method: POST
path: "/resources/files/{id}/favorite"
tags: ["Files"]
---

# Favorite or unfavorite a file

`POST /resources/files/{id}/favorite`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/resources/files/{id}/favorite`
- Auth: HTTP bearer

Idempotent. Sending `true` bookmarks the file for the caller's account, `false` removes the bookmark.

## Path parameters

- `id` string, required

## Request body

- ResourceFavoriteRequest
  - `favorite` boolean, required

## Response `200`

Current favorite state

- ResourceFavoriteResult
  - `id` string
  - `is_favorite` boolean

## Other responses

- `400`: Body is not valid JSON (`invalid_json`) or `favorite` is not a boolean (`missing_field`)
- `401`: Missing or invalid API key / JWT
- `404`: Unknown file (or not owned by the caller)

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/resources/files/:id/favorite/post.md)

---

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