---
title: "Toggle the caller's favorite mark on one item (kind + ref_id)."
method: POST
path: "/api/v1/prefs/favorites"
tags: ["User Prefs"]
---

# Toggle the caller's favorite mark on one item (kind + ref_id).

`POST /api/v1/prefs/favorites`

## Request

- Base URL: `https://api.avatarfactory.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.avatarfactory.io/api/v1/prefs/favorites`
- Auth: one of:
  - API key in cookie `session`
  - HTTP bearer

<br/>Idempotent per (user, kind, ref): favoriting an already-favorited item<br/>un-favorites it. Returns the new `favorited` state. 400 for an unknown<br/>`kind`. Emits `favorite_changed`.

## Request body

- ToggleFavoriteRequest: Body for POST /api/v1/prefs/favorites.
  - `kind` string, required
  - `ref_id` integer, required

## Response `200`

OK

- ToggleFavoriteResponse
  - `favorited` boolean, required
  - `kind` string, required
  - `ok` boolean, required
  - `ref_id` integer, required

## Other responses

- `400`: Bad Request
- `422`: Unprocessable Entity

---

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