> For the complete documentation index, see [llms.txt](https://sugoi.gitbook.io/lanraragi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sugoi.gitbook.io/lanraragi/dev/api-documentation/tankoubon-api.md).

# Tankoubon API

## Get all Tankoubons

> Get list of Tankoubons paginated.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/tankoubons":{"get":{"operationId":"getTankoubonList","summary":"Get all Tankoubons","description":"Get list of Tankoubons paginated.","tags":["tankoubons"],"parameters":[{"name":"page","in":"query","required":false,"description":"Page of the list of Tankoubons.  \nThe amount of tanks per page depends on the server `archives_per_page` setting.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Tankoubons","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"$ref":"#/components/schemas/TankoubonMetadataJson"}},"total":{"type":"integer","description":"Total count of Tankoubons on the server"},"filtered":{"type":"integer","description":"Number of Tankoubons on the current page"}}}}}}}}}},"components":{"schemas":{"TankoubonMetadataJson":{"type":"object","description":"Tankoubon metadata as returned by the list endpoint","required":["id"],"properties":{"id":{"type":"string","description":"ID of the tankoubon"},"name":{"type":"string","description":"Name of the tankoubon"},"summary":{"type":"string","description":"Summary of the tankoubon"},"tags":{"type":"string","description":"Tags associated with the tankoubon"},"archives":{"type":"array","description":"Array of archive IDs","items":{"type":"string","minLength":40,"maxLength":40}},"progress":{"type":"integer","description":"Reading progress (page number) for this Tankoubon"}}}}}}
```

## 🔑 Create a Tankoubon

> Create a new Tankoubon or update the name of an existing one.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header","description":"Use Authorization: Bearer <base64(api_key)>"}},"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}},"paths":{"/tankoubons":{"put":{"operationId":"createTankoubon","summary":"🔑 Create a Tankoubon","description":"Create a new Tankoubon or update the name of an existing one.","tags":["tankoubons"],"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the Tankoubon"},"tankid":{"type":"string","description":"ID of an existing Tankoubon, if you want to change its name."}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name of the Tankoubon"},"tankid":{"type":"string","description":"ID of an existing Tankoubon, if you want to change its name."}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","enum":["create_tankoubon"]},"tankoubon_id":{"type":"string","description":"ID of the created/modified Tankoubon"},"success":{"type":"integer","enum":[0,1]}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## Get a single Tankoubon

> Get the details of the specified tankoubon ID.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/tankoubons/{id}":{"get":{"operationId":"getTankoubon","summary":"Get a single Tankoubon","description":"Get the details of the specified tankoubon ID.","tags":["tankoubons"],"responses":{"200":{"description":"Tankoubon","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID of this Tankoubon."},"name":{"type":"string","description":"Name of this Tankoubon."},"summary":{"type":"string"},"tags":{"type":"string"},"archives":{"type":"array","description":"Full list of archive IDs contained in this Tankoubon.","items":{"type":"string","oneOf":[{"minLength":40,"maxLength":40,"pattern":"^[0-9a-f]{40}$"},{"minLength":15,"maxLength":15,"pattern":"^TANK_[0-9]{10}$"}]},"uniqueItems":true},"progress":{"type":"integer","description":"Reading progress (page number) for this Tankoubon."}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}},"components":{"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}}}
```

## 🔑 Update Tankoubon metadata/contents

> Modify the full metadata (name, summary, additional tags) or the contents of a Tankoubon.  \
> If you only need to change the name of Tank, consider just using PUT \`/api/tankoubons\`.  \
> \
> Note: If there is no need to update something in one of the \`data\` keys, do not send the key -- This otherwise can result in unwanted results.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header","description":"Use Authorization: Bearer <base64(api_key)>"}},"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}},"paths":{"/tankoubons/{id}":{"put":{"operationId":"updateTankoubon","summary":"🔑 Update Tankoubon metadata/contents","description":"Modify the full metadata (name, summary, additional tags) or the contents of a Tankoubon.  \nIf you only need to change the name of Tank, consider just using PUT `/api/tankoubons`.  \n\nNote: If there is no need to update something in one of the `data` keys, do not send the key -- This otherwise can result in unwanted results.","tags":["tankoubons"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Tankoubon to update.","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Json with 2 optional keys \"archives\" and \"metadata\"","content":{"application/json":{"schema":{"type":"object","properties":{"archives":{"description":"Ordered array with the IDs of the archives.","type":"array","items":{"type":"string","minLength":40,"maxLength":40}},"metadata":{"description":"Metadata parameters -- All are optional.","type":"object","properties":{"name":{"type":"string","description":"Name of the Tankoubon"},"summary":{"type":"string","description":"Summary of the Tankoubon"},"tags":{"type":"string","description":"Additional tags for the Tankoubon, in LRR comma-separated format. This will replace whatever additional tags the Tank already has, unless append=true."},"append":{"type":"boolean","description":"If true, tags are appended to the Tank's existing own tags instead of replacing them. Defaults to false."}}}}}}}},"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"The Tankoubon is currently locked for modification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## 🔑 Delete Tankoubon

> Remove a Tankoubon from the server. This doesn't delete underlying Archives.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header","description":"Use Authorization: Bearer <base64(api_key)>"}},"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}},"paths":{"/tankoubons/{id}":{"delete":{"operationId":"deleteTankoubon","summary":"🔑 Delete Tankoubon","description":"Remove a Tankoubon from the server. This doesn't delete underlying Archives.","tags":["tankoubons"],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"The Tankoubon is currently locked for modification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## 🔑 Add an Archive to a Tankoubon

> Append an archive at the final position of a Tankoubon.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header","description":"Use Authorization: Bearer <base64(api_key)>"}},"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}},"paths":{"/tankoubons/{id}/{archive}":{"put":{"operationId":"addToTankoubon","summary":"🔑 Add an Archive to a Tankoubon","description":"Append an archive at the final position of a Tankoubon.","tags":["tankoubons"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Tankoubon to update.","schema":{"type":"string"}},{"name":"archive","in":"path","required":true,"description":"ID of the Archive to append.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"The Tankoubon is currently locked for modification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## DELETE /tankoubons/{id}/{archive}

> 🔑 Remove an Archive from a Tankoubon

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header","description":"Use Authorization: Bearer <base64(api_key)>"}},"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}},"paths":{"/tankoubons/{id}/{archive}":{"delete":{"operationId":"removeFromTankoubon","summary":"🔑 Remove an Archive from a Tankoubon","tags":["tankoubons"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Tankoubon to update.","schema":{"type":"string"}},{"name":"archive","in":"path","required":true,"description":"ID of the Archive to remove.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"The Tankoubon is currently locked for modification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## Get Tankoubon thumbnail

> Get the cover thumbnail for a given Tankoubon.  By default, the thumbnail is sourced from the first page of the first archive.  This endpoint will return a placeholder image if it doesn't already exist.  If you want to queue generation of the thumbnail in the background,  you can use the no\_fallback query parameter.&#x20;

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/tankoubons/{id}/thumbnail":{"get":{"operationId":"getTankoubonThumbnail","summary":"Get Tankoubon thumbnail","description":"Get the cover thumbnail for a given Tankoubon.  By default, the thumbnail is sourced from the first page of the first archive.  This endpoint will return a placeholder image if it doesn't already exist.  If you want to queue generation of the thumbnail in the background,  you can use the no_fallback query parameter. ","tags":["tankoubons"],"parameters":[{"name":"no_fallback","in":"query","required":false,"description":"Disables the placeholder image, queues the thumbnail for extraction and returns a JSON with code 202. This parameter does nothing if the image already exists. (You will get the image with code 200 no matter what)","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"If the thumbnail was already extracted, you get it directly.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"202":{"description":"The thumbnail is queued for extraction. Use `/api/minion/:jobid` to track when your thumbnail is ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinionJobResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}},"components":{"schemas":{"MinionJobResponse":{"type":"object","description":"JSON object for a queued Minion job.","required":["job","operation","success"],"properties":{"job":{"type":"integer","description":"Minion job ID"},"operation":{"type":"string","description":"Name of operation"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[1,0]}}},"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}}}
```

## 🔑 Update Tankoubon thumbnail

> Set the cover thumbnail for the given Tankoubon using a global page number that spans all archives in the tank (in order). The global page is translated to the correct archive and local page automatically.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"Authorization","in":"header","description":"Use Authorization: Bearer <base64(api_key)>"}},"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}},"paths":{"/tankoubons/{id}/thumbnail":{"put":{"operationId":"updateTankoubonThumbnail","summary":"🔑 Update Tankoubon thumbnail","description":"Set the cover thumbnail for the given Tankoubon using a global page number that spans all archives in the tank (in order). The global page is translated to the correct archive and local page automatically.","tags":["tankoubons"],"parameters":[{"name":"page","in":"query","required":true,"description":"Global 1-indexed page number across all archives in the tankoubon. Page 1 is the first page of the first archive, and so on.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Tankoubon thumbnail updated","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","enum":["update_tankoubon_thumbnail"]},"success":{"type":"integer","enum":[0,1]},"new_thumbnail":{"type":"string","description":"Path to the new thumbnail file"}}}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## Update Tankoubon reading progression

> Tell the server which page of this Tankoubon you're currently reading, so that it updates its internal reading progression accordingly.\
> The page number is global across all Archives in the tank  (If a tank has two Archives with 20 and 25 pages, page 26 will be page 6 in Archive #2).\
> ⚠ If the server is configured to use clientside progress tracking, this API call will return an error!\
> Make sure to check using \`/api/info\` whether the server tracks reading progression or not before calling this endpoint.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"tankoubons","description":"Endpoints related to Tankoubons."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/tankoubons/{id}/progress/{page}":{"put":{"operationId":"updateTankoubonProgress","summary":"Update Tankoubon reading progression","description":"Tell the server which page of this Tankoubon you're currently reading, so that it updates its internal reading progression accordingly.\nThe page number is global across all Archives in the tank  (If a tank has two Archives with 20 and 25 pages, page 26 will be page 6 in Archive #2).\n⚠ If the server is configured to use clientside progress tracking, this API call will return an error!\nMake sure to check using `/api/info` whether the server tracks reading progression or not before calling this endpoint.","tags":["tankoubons"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Tankoubon to update.","schema":{"type":"string","minLength":15,"maxLength":15}},{"name":"page","in":"path","required":true,"description":"Global 1-indexed page number to update the reading progress to. Must be a positive integer.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":15,"maxLength":15,"description":"ID of the tankoubon updated"},"operation":{"type":"string","description":"Name of the operation","enum":["update_tank_progress"]},"page":{"type":"integer","description":"Updated reading progress"},"lastreadtime":{"type":"integer","description":"Last read time in epoch seconds"},"success":{"type":"integer","enum":[0,1],"description":"Returns 1 if successful, else 0"}}}}}},"400":{"description":"Generic error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"401":{"description":"Authentication required when authprogress is enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}},"components":{"schemas":{"OperationResponse":{"type":"object","required":["operation","success"],"properties":{"operation":{"type":"string","description":"Name of operation"},"error":{"type":"string","description":"Error message if any"},"successMessage":{"type":"string","description":"Success message if any"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sugoi.gitbook.io/lanraragi/dev/api-documentation/tankoubon-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
