---
title: "Toggle favorite"
method: POST
path: "/templates/{id}/favorite"
tags: ["Templates"]
---

# Toggle favorite

`POST /templates/{id}/favorite`

## Request

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

Favorites the template if it is not favorited, otherwise removes the
favorite. Requires a key bound to a user.

## Response `200`

New favorite state

- TemplateFavoriteResponse
  - `favorited` boolean: New favorite state after the toggle
  - `templateId` string, uuid

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key / JWT
- `404`: Template or document not found
- `422`: The key is not bound to a user account

## Changes

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

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/templates/: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)
