---
title: "Rate a book"
method: POST
path: "/api/books/{book_id}/rating"
tags: ["books"]
---

# Rate a book

`POST /api/books/{book_id}/rating`

## Request

- Base URL: `https://leafle.org` (the document declares no server; this is the origin it was published from)
- URL: `https://leafle.org/api/books/{book_id}/rating`
- Auth: HTTP bearer

**Access: write token.**

Set loved or liked, or use none to clear the rating. Setting loved/liked also records the book as read.

## Path parameters

- `book_id` integer, required

## Request body

- BookRatingIn
  - `rating` 'loved' | 'liked' | 'none', required
  - `reader_id` integer, nullable

## Response `200`

Successful Response

- Ok: The mutation acknowledgement: ``{"ok": true}``.
  - `ok` boolean, required

## Other responses

- `401`: Missing or unusable credential.
- `403`: Insufficient token scope or the reader is outside your account.
- `404`: No such resource for this reader, or the requested daily find is unavailable.
- `422`: Validation Error

---

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