# Archive API

## Get all Archives

> Returns a list of all archives in the database.  You can use the IDs of this JSON with the other endpoints.<br>

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives":{"get":{"operationId":"getAllArchives","summary":"Get all Archives","description":"Returns a list of all archives in the database.  You can use the IDs of this JSON with the other endpoints.\n","tags":["archives"],"responses":{"200":{"description":"Array of archives","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ArchiveMetadataJson"}}}}}}}}},"components":{"schemas":{"ArchiveMetadataJson":{"type":"object","description":"JSON object for archive metadata for most API responses","required":["arcid","title","filename","tags","isnew","extension","progress","pagecount","lastreadtime","size"],"properties":{"arcid":{"type":"string","description":"Unique identifier for the archive (40-char SHA1) or tankoubon (15-char TANK_* ID)","oneOf":[{"minLength":40,"maxLength":40,"pattern":"^[0-9a-f]{40}$"},{"minLength":15,"maxLength":15,"pattern":"^TANK_[0-9]{10}$"}]},"title":{"type":"string","description":"Title of the archive"},"filename":{"type":"string","description":"Filename of the archive"},"tags":{"type":"string","description":"Comma-separated list of tags associated with the archive"},"summary":{"type":"string","nullable":true,"description":"Summary description of the archive"},"isnew":{"oneOf":[{"type":"boolean"},{"type":"string"}],"nullable":true,"description":"Whether the archive is newly added."},"extension":{"type":"string","description":"File extension of the archive"},"progress":{"type":"integer","description":"Reading progress (page number)"},"pagecount":{"type":"integer","description":"Total number of pages in the archive"},"lastreadtime":{"type":"integer","description":"Unix timestamp of when the archive was last read"},"size":{"type":"integer","description":"Size of the archive in bytes"},"toc":{"type":"array","description":"Table of contents for the archive"}}}}}}
```

## Get all untagged archives

> Get archives that don't have any tags recorded.  This follows the same rules as the Batch Tagging filter and will include archives that have parody:, date\_added:, series: or artist: tags.<br>

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/untagged":{"get":{"operationId":"getUntaggedArchives","summary":"Get all untagged archives","description":"Get archives that don't have any tags recorded.  This follows the same rules as the Batch Tagging filter and will include archives that have parody:, date_added:, series: or artist: tags.\n","tags":["archives"],"responses":{"200":{"description":"Array of archive IDs","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","minLength":40,"maxLength":40}}}}}}}}}}
```

## 🔑 Upload Archive

> Upload an Archive to the server.  \
> If a SHA1 checksum of the Archive is included, the server will perform an optional in-transit, file integrity validation, and reject the upload if the server-side checksum does not match.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"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":{"/archives/upload":{"put":{"operationId":"uploadArchive","summary":"🔑 Upload Archive","description":"Upload an Archive to the server.  \nIf a SHA1 checksum of the Archive is included, the server will perform an optional in-transit, file integrity validation, and reject the upload if the server-side checksum does not match.","tags":["archives"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Archive file to upload"},"file_checksum":{"type":"string","description":"SHA1 checksum of the archive for in-transit validation.","pattern":"^[a-fA-F0-9]{40}$"},"category_id":{"type":"string","description":"Category ID you'd want the archive to be added to.","minLength":14,"maxLength":14},"tags":{"type":"string","description":"Set of tags you want to insert in the database alongside the archive."},"title":{"type":"string","description":"Title of the Archive."},"summary":{"type":"string","description":"Summary of the Archive."}}}}}},"responses":{"200":{"description":"Archive uploaded successfully","content":{"application/json":{"schema":{"type":"object","required":["operation","success","id"],"properties":{"operation":{"type":"string","description":"Name of operation"},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[1]},"id":{"type":"string","minLength":40,"maxLength":40,"description":"ID of the uploaded archive"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"409":{"description":"Duplicate archive","content":{"application/json":{"schema":{"type":"object","required":["operation","success","error","id"],"properties":{"operation":{"type":"string","description":"Name of operation","enum":["upload"]},"success":{"type":"integer","enum":[0],"description":"Returns 0 for failed operation"},"error":{"type":"string","description":"Error message indicating the archive already exists"},"id":{"type":"string","minLength":40,"maxLength":40,"description":"ID of the existing archive"}}}}}},"415":{"description":"Unsupported file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"417":{"description":"Checksum mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"Locked resource response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## 🔑 Delete archive

> Delete both the archive metadata and the file stored on the server.  \
> 🙏 Please ask your user for confirmation before invoking this endpoint.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"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":{"/archives/{id}":{"delete":{"operationId":"deleteArchive","summary":"🔑 Delete archive","description":"Delete both the archive metadata and the file stored on the server.  \n🙏 Please ask your user for confirmation before invoking this endpoint.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Archive deleted response","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","description":"Name of the operation","enum":["delete_archive"]},"id":{"type":"string","minLength":40,"maxLength":40,"description":"ID of the archive"},"filename":{"type":"string","description":"Filename of the deleted archive"},"success":{"type":"integer","enum":[0,1],"description":"Returns 1 if operation was successful, else 0"}}}}}},"400":{"description":"No archive ID response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"Locked resource response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## Get archive metadata

> Get Metadata (title, tags) for a given Archive.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/metadata":{"get":{"operationId":"getArchiveMetadata","summary":"Get archive metadata","description":"Get Metadata (title, tags) for a given Archive.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Archive metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveMetadataJson"}}}},"400":{"description":"No archive ID response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}},"components":{"schemas":{"ArchiveMetadataJson":{"type":"object","description":"JSON object for archive metadata for most API responses","required":["arcid","title","filename","tags","isnew","extension","progress","pagecount","lastreadtime","size"],"properties":{"arcid":{"type":"string","description":"Unique identifier for the archive (40-char SHA1) or tankoubon (15-char TANK_* ID)","oneOf":[{"minLength":40,"maxLength":40,"pattern":"^[0-9a-f]{40}$"},{"minLength":15,"maxLength":15,"pattern":"^TANK_[0-9]{10}$"}]},"title":{"type":"string","description":"Title of the archive"},"filename":{"type":"string","description":"Filename of the archive"},"tags":{"type":"string","description":"Comma-separated list of tags associated with the archive"},"summary":{"type":"string","nullable":true,"description":"Summary description of the archive"},"isnew":{"oneOf":[{"type":"boolean"},{"type":"string"}],"nullable":true,"description":"Whether the archive is newly added."},"extension":{"type":"string","description":"File extension of the archive"},"progress":{"type":"integer","description":"Reading progress (page number)"},"pagecount":{"type":"integer","description":"Total number of pages in the archive"},"lastreadtime":{"type":"integer","description":"Unix timestamp of when the archive was last read"},"size":{"type":"integer","description":"Size of the archive in bytes"},"toc":{"type":"array","description":"Table of contents for the archive"}}},"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 archive metadata

> Update tags and title for the given Archive.  \
> Data supplied to the server through this method will \*\*overwrite\*\* the previous data.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"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":{"/archives/{id}/metadata":{"put":{"operationId":"updateArchiveMetadata","summary":"🔑 Update archive metadata","description":"Update tags and title for the given Archive.  \nData supplied to the server through this method will **overwrite** the previous data.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"title","in":"query","required":false,"description":"New Title of the Archive.","schema":{"type":"string"}},{"name":"tags","in":"query","required":false,"description":"New Tags of the Archive.","schema":{"type":"string"}},{"name":"summary","in":"query","required":false,"description":"New Summary of the Archive.","schema":{"type":"string"}}],"responses":{"200":{"description":"Archive metadata updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"No archive ID response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"Locked resource response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## Get archive thumbnail

> Get a Thumbnail image for a given 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. This will give you a background job ID instead of the placeholder.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/thumbnail":{"get":{"operationId":"getArchiveThumbnail","summary":"Get archive thumbnail","description":"Get a Thumbnail image for a given 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. This will give you a background job ID instead of the placeholder.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the archive to process","schema":{"type":"string","maxLength":40,"minLength":40}},{"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"]}},{"name":"page","in":"query","required":false,"description":"Specify which page you want to get a thumbnail for. Defaults to the cover, aka page 1.","schema":{"type":"integer","minimum":0}}],"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":"No archive ID 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 archive thumbnail

> Update the cover thumbnail for the given Archive. You can specify a page number to use as the thumbnail, or you can use the default thumbnail.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"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":{"/archives/{id}/thumbnail":{"put":{"operationId":"updateArchiveThumbnail","summary":"🔑 Update archive thumbnail","description":"Update the cover thumbnail for the given Archive. You can specify a page number to use as the thumbnail, or you can use the default thumbnail.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"page","in":"query","required":false,"description":"Page you want to make the thumbnail out of. Defaults to 1.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Archive thumbnail updated","content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"type":"string","description":"Name of operation","enum":["update_thumbnail"]},"success":{"type":"integer","description":"Returns 1 if operation was successful, else 0","enum":[0,1]},"new_thumbnail":{"type":"string","description":"New thumbnail URL"}}}}}},"400":{"description":"No archive ID response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## 🔑 Add entry to Archive Table of Contents

> Add an entry to the Table of Contents of a given Archive.   The ToC is stored as a JSON-encoded key-value array mapping a page to a title for the chapter/section starting at that page. &#x20;

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"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":{"/archives/{id}/toc":{"put":{"operationId":"addArchiveToc","summary":"🔑 Add entry to Archive Table of Contents","description":"Add an entry to the Table of Contents of a given Archive.   The ToC is stored as a JSON-encoded key-value array mapping a page to a title for the chapter/section starting at that page.  ","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"page","in":"query","required":true,"description":"Page number where the chapter/section starts.","schema":{"type":"integer"}},{"name":"title","in":"query","required":true,"description":"Title of the chapter/section.","schema":{"type":"string"}}],"responses":{"200":{"description":"Archive TOC updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"No archive ID response or other error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"Locked resource response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## 🔑 Remove entry from Archive Table of Contents

> Delete an entry from the Table of Contents of a given Archive. &#x20;

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"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":{"/archives/{id}/toc":{"delete":{"operationId":"deleteArchiveToc","summary":"🔑 Remove entry from Archive Table of Contents","description":"Delete an entry from the Table of Contents of a given Archive.  ","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"page","in":"query","required":true,"description":"Page number of the chapter/section to delete.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Archive TOC updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"No archive ID response or other error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"Locked resource response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## Get archive categories

> Get all the Categories which currently refer to this Archive ID.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/categories":{"get":{"operationId":"getArchiveCategories","summary":"Get archive categories","description":"Get all the Categories which currently refer to this Archive ID.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Archive categories","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","description":"Array of category metadata","items":{"$ref":"#/components/schemas/CategoryMetadataJson"}},"operation":{"type":"string","description":"Name of the operation","enum":["find_arc_categories"]},"success":{"type":"integer","enum":[0,1],"description":"Returns 1 if operation was successful, else 0"}}}}}},"400":{"description":"No archive ID response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}},"components":{"schemas":{"CategoryMetadataJson":{"type":"object","description":"Category metadata.","required":["id"],"properties":{"archives":{"type":"array","description":"Array of archive IDs (if this is a static category, empty otherwise)","items":{"type":"string","minLength":40,"maxLength":40}},"id":{"type":"string","description":"ID of the category","minLength":14,"maxLength":14},"name":{"type":"string","description":"Name of the category"},"pinned":{"type":"integer","description":"Whether this category should be pinned in the UI","enum":[0,1]},"search":{"type":"string","description":"Category search filter (if this is a dynamic category, empty otherwise)","nullable":true}}},"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]}}}}}}
```

## Get archive tankoubons

> Get all the Tankoubons which currently refer to this Archive ID.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/tankoubons":{"get":{"operationId":"getArchiveTankoubons","summary":"Get archive tankoubons","description":"Get all the Tankoubons which currently refer to this Archive ID.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Archive tankoubons","content":{"application/json":{"schema":{"type":"object","properties":{"tankoubons":{"type":"array","description":"Array of tankoubon IDs","items":{"type":"string","minLength":15,"maxLength":15}},"operation":{"type":"string","description":"Name of the operation","enum":["find_arc_tankoubons"]},"success":{"type":"integer","enum":[0,1],"description":"Returns 1 if operation was successful, else 0"}}}}}},"400":{"description":"No archive ID 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]}}}}}}
```

## Download archive

> Download an Archive from the server.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/download":{"get":{"operationId":"downloadArchive","summary":"Download archive","description":"Download an Archive from the server.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to download.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Archive file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"No archive ID 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]}}}}}}
```

## Extract an Archive

> Get a list of URLs pointing to the images contained in an archive.  If necessary, this endpoint also launches a background Minion job to extract the archive so it is ready for reading.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/files":{"get":{"operationId":"getFiles","summary":"Extract an Archive","description":"Get a list of URLs pointing to the images contained in an archive.  If necessary, this endpoint also launches a background Minion job to extract the archive so it is ready for reading.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"force","in":"query","required":false,"description":"Force a full background re-extraction of the Archive. Existing cached files might still be used in subsequent `/api/archives/:id/page` calls until the Archive is fully re-extracted.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"You get page URLs, and the ID of the background extract job.","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"integer","description":"ID of the background extract job"},"pages":{"type":"array","items":{"type":"string","description":"Page URLs"}}}}}}},"400":{"description":"No archive ID 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]}}}}}}
```

## Extract page thumbnails

> Create thumbnails for every page of a given Archive.   This endpoint will queue generation of the thumbnails in the background.  \
> \
> If all thumbnails are detected as already existing, the call will return HTTP code 200.  \
> This endpoint can be called multiple times -- If a thumbnailing job is already in progress for the given ID, it'll just give you the ID for that ongoing job.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/files/thumbnails":{"post":{"operationId":"queueArchivePageThumbnailExtraction","summary":"Extract page thumbnails","description":"Create thumbnails for every page of a given Archive.   This endpoint will queue generation of the thumbnails in the background.  \n\nIf all thumbnails are detected as already existing, the call will return HTTP code 200.  \nThis endpoint can be called multiple times -- If a thumbnailing job is already in progress for the given ID, it'll just give you the ID for that ongoing job.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"force","in":"query","required":false,"description":"Whether to force regeneration of all thumbnails even if they already exist.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"If thumbnails are already extracted and `force=0`","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"operation":{"type":"string","description":"Name of operation","enum":["generate_page_thumbnails"]},"success":{"type":"string","description":"Returns 1 if operation was successful, else 0","enum":[0,1]}}}}}},"202":{"description":"The thumbnails are queued for extraction. You can use `/api/minion/:jobid` to track progress, by looking at `notes->progress` and `notes->pages`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinionJobResponse"}}}},"400":{"description":"No archive ID 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]}}}}}}
```

## Get an archive page

> Get an archive page. This call is mainly used alongside \`/api/archives/files\`.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/page":{"get":{"operationId":"getPage","summary":"Get an archive page","description":"Get an archive page. This call is mainly used alongside `/api/archives/files`.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to download.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"path","in":"query","required":true,"description":"Path to the image."}],"responses":{"200":{"description":"Archive page","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"No archive ID 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 reading progression

> Tell the server which page of this Archive you're currently showing/reading, so that it updates its internal reading progression accordingly.  \
> This endpoint will also update the date this Archive was last read, using the current server timestamp.  \
> \
> You should call this endpoint only when you're sure the user is currently reading the page you present.  \
> \*\*Don't\*\* use it when preloading images off the server.\
> \
> Whether to make reading progression regressible or not is up to the client. (The web client will reduce progression if the user starts reading previous pages)  \
> Consider however removing the "New!" flag from an archive when you start updating its progress - The web client won't display any reading progression if the new flag is still set.  \
> \
> ⚠ 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":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/progress/{page}":{"put":{"operationId":"updateArchiveProgress","summary":"Update reading progression","description":"Tell the server which page of this Archive you're currently showing/reading, so that it updates its internal reading progression accordingly.  \nThis endpoint will also update the date this Archive was last read, using the current server timestamp.  \n\nYou should call this endpoint only when you're sure the user is currently reading the page you present.  \n**Don't** use it when preloading images off the server.\n\nWhether to make reading progression regressible or not is up to the client. (The web client will reduce progression if the user starts reading previous pages)  \nConsider however removing the \"New!\" flag from an archive when you start updating its progress - The web client won't display any reading progression if the new flag is still set.  \n\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":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}},{"name":"page","in":"path","required":true,"description":"Current page to update the reading progress to.  \n**Must** be a positive integer, and inferior or equal to the total page number of the archive.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":40,"maxLength":40,"description":"ID of the archive updated"},"operation":{"type":"string","description":"Name of the operation","enum":["update_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"}}}},"423":{"description":"Locked resource 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]}}}}}}
```

## 🔑 Set Archive New flag

> Sets/Restores the "New!" flag on an archive.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"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":{"/archives/{id}/isnew":{"put":{"operationId":"setNewArchiveFlag","summary":"🔑 Set Archive New flag","description":"Sets/Restores the \"New!\" flag on an archive.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"400":{"description":"No archive ID response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"Locked resource response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}}}}}}}
```

## Clear Archive New flag

> Clears the "New!" flag on an archive.

```json
{"openapi":"3.1.0","info":{"title":"LANraragi API","version":"0.9.6"},"tags":[{"name":"archives","description":"Everything dealing with Archives."}],"servers":[{"url":"https://lrr.tvc-16.science/api"}],"paths":{"/archives/{id}/isnew":{"delete":{"operationId":"clearNewArchiveFlag","summary":"Clear Archive New flag","description":"Clears the \"New!\" flag on an archive.","tags":["archives"],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the Archive to process.","schema":{"type":"string","minLength":40,"maxLength":40}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","required":["id","operation","success"],"properties":{"id":{"type":"string","minLength":40,"maxLength":40,"description":"ID of the archive"},"operation":{"type":"string","description":"Name of the operation","enum":["clear_new"]},"success":{"type":"integer","enum":[0,1],"description":"Returns 1 if successful, else 0"}}}}}},"400":{"description":"No archive ID response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"423":{"description":"Locked resource 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]}}}}}}
```
