---
title: "Sync with Hardcover"
method: POST
path: "/api/hardcover/sync"
tags: ["books"]
---

# Sync with Hardcover

`POST /api/hardcover/sync`

## Request

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

**Access: write token.**

Run a sync for the existing connection and return the result. Inspect `ok`, `reason` and `error` even on HTTP 200. `reader_id` is a query parameter.

## Query parameters

- `reader_id` integer, nullable

## Response `200`

Successful Response

- HardcoverSyncResult: POST /api/hardcover/sync — what one sync run did. `unmatched` is reported rather than hidden: a queued book Hardcover has no record of is a real outcome the reader may want to know about, and silently dropping it would look like the sync had worked.
  - `ok` boolean, required
  - `reason` string, nullable
  - `error` string, nullable
  - `books_seen` integer
  - `new_books` integer
  - `added` integer
  - `updated` integer
  - `removed` integer
  - `unmatched` integer

## Other responses

- `401`: Missing or unusable credential.
- `403`: Insufficient token scope or the reader is outside your account.
- `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)
