---
title: "Save your library choices"
method: PUT
path: "/api/reader/libraries"
tags: ["libraries"]
---

# Save your library choices

`PUT /api/reader/libraries`

## Request

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

**Access: write token.**

Send up to eight ordered library IDs from directory results. `ids: []` explicitly declines library use; `ids: null` clears the choice. If confirming a chat offer, include its `offer_id`; a superseded offer returns 409. Buying preferences are unchanged.

## Request body

- SaveLibrariesIn
  - `reader_id` integer, nullable
  - `offer_id` string, nullable
  - `ids` string[], nullable, required: Ordered library IDs; [] declines library use; null clears the selection.

## Response `200`

Successful Response

- SavedLibraries
  - `libraries` LibraryPlace[], required
    - `id` string, required
    - `service_code` string, nullable, required
    - `service` string, required
    - `name` string, required
    - `branch` string, nullable, required
    - `country` string, required
    - `url` string, nullable, required
    - `lat` number, nullable, required
    - `lng` number, nullable, required
    - `covered` boolean, required
    - `kind` string, required
    - `distance_km` number, nullable
  - `explicit` boolean, required
  - `pending_offer_id` string, nullable

## Other responses

- `401`: Missing or unusable credential.
- `403`: Insufficient token scope or the reader is outside your account.
- `409`: Conflicting state: a turn is running, the book is already read, or the library offer has been settled.
- `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)
