Skip to content

Archive API

24 endpoints.

DELETE /archives (issue #63), body {ids: [...]} — same “plural resource, DELETE with a

Section titled “DELETE /archives (issue #63), body {ids: [...]} — same “plural resource, DELETE with a”
DELETEhttp://localhost:3000/api/archives

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/archives.rs:616), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


DELETE /archives (issue #63), body {ids: [...]} — same “plural resource, DELETE with a JSON body carrying which ones” shape activity.rs::bulk_delete_activity (DELETE /activity) already established in this codebase, not a POST .../batch-delete action-style path; DELETE can carry a request body per RFC 9110 (silently dropped by some older proxies/clients in practice, but Axum and this project’s own frontend both handle it fine, and precedent already exists here). The Batch page’s own “delete archives” operation previously fired DELETE /archives/{id} once per selected archive from the frontend as a plain sequential loop (no atomicity, no single audit point, and — since each request only ever reported its own pass/fail — no way for the caller to know which ids failed without diffing the library before/after). This does the same per-id work (delete_one_archive, identical cleanup to the single-delete endpoint) server-side in one request, and reports a per-id result list so the frontend can show exactly what happened rather than assuming full success.

Session-only (route_policy.csv denies every token role and anonymous) — deliberately stricter than every other archive-mutating endpoint in this file, all of which a Token (Admin or Guest) can call. A single wrong/leaked API token being able to wipe an arbitrary-sized slice of the library in one request is a materially larger blast radius than any one of the single-target endpoints token access already permits, and this project has no legitimate automation use case for bulk deletion the way it does for e.g. scripted uploads or metadata edits — so the extra restriction has no real workflow it breaks.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/archives.rs:207.

This response carries no example body.

This endpoint accepts a browser session only — the cookie set when you log in to your own instance. API tokens are refused by the server, so there is no token field here and the command above carries no Authorization header.

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives

Returns a list of all Archives in the database. This doesn’t include Tankoubons by design. You can use the IDs of this JSON with the other endpoints.

Responses

200Array of archives
[
  {
    "arcid": "28697b96f0ac5858be2614ed10ca47742c9522fd",
    "extension": "rar",
    "filename": "Fate GO MEMO",
    "isnew": false,
    "lastreadtime": 1337038281,
    "pagecount": 34,
    "progress": 3,
    "size": 1234567,
    "summary": null,
    "tags": "parody:fate grand order,  group:wadamemo,  artist:wada rco,  artbook,  full color",
    "title": "Fate GO MEMO",
    "toc": [
      {
        "name": "Chapter 1",
        "page": 1
      },
      {
        "name": "Chapter 2",
        "page": 13
      },
      {
        "name": "Chapter 3",
        "page": 25
      }
    ]
  }
]

Your own instance address. Requests go from this browser straight to it.

DELETEhttp://localhost:3000/api/archives/{id}

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

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Responses

200Archive deleted response
{
  "filename": "big_chungus.zip",
  "id": "75d18ce470dc99f83dc355bdad66319d1f33c82b",
  "operation": "delete_archive",
  "success": 1
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/categories

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

Path parameters

idstringrequired
ID of the Archive to process.

Responses

200Archive categories
{
  "categories": [
    {
      "archives": [
        "0d50858d727723d856d2ab78564bb8e906e65f14",
        "7f03b8b1f337e1e42b2c2890533c0de7479d41ca"
      ],
      "id": "SET_1613080290",
      "name": "My great category",
      "pinned": 0,
      "search": null
    },
    {
      "archives": [
        "0d50858d727723d856d2ab78564bb8e906e65f14",
        "75d18ce470dc99f83dc355bdad66319d1f33c82b"
      ],
      "id": "SET_1613080294",
      "name": "My other category",
      "pinned": 1,
      "search": null
    }
  ],
  "operation": "find_arc_categories",
  "success": 1
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/download

Download an Archive from the server.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to download.

Responses

200Archive file

This response carries no example body.

400No archive ID response
{
  "error": "No archive ID specified.",
  "operation": "download_archive",
  "success": 0
}

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/files

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.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Query parameters

forcebooleanoptional
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.

Responses

200You get page URLs, and the ID of the background extract job.
{
  "job": 561,
  "pages": [
    ".\\/api\\/archives\\/28697b96f0ac5858be2614ed10ca47742c9522fd\\/page&path=00.jpg",
    ".\\/api\\/archives\\/28697b96f0ac5858be2614ed10ca47742c9522fd\\/page&path=01.jpg"
  ]
}
400No archive ID response
{
  "error": "No archive ID specified.",
  "operation": "get_file_list",
  "success": 0
}

Your own instance address. Requests go from this browser straight to it.

POSThttp://localhost:3000/api/archives/{id}/files/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.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Query parameters

forcebooleanoptional
Whether to force regeneration of all thumbnails even if they already exist.

Responses

200If thumbnails are already extracted and `force=0`
{
  "message": "No job queued, all thumbnails already exist.",
  "operation": "generate_page_thumbnails",
  "success": 1
}
202The thumbnails are queued for extraction. You can use `/api/minion/:jobid` to track progress, by looking at `notes->progress` and `notes->pages`.
{
  "job": 0,
  "operation": "",
  "success": 1
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

DELETEhttp://localhost:3000/api/archives/{id}/isnew

Clears the “New!” flag on an archive.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Responses

200Successful response
{
  "id": "d07ff399dddb25a0408385bc75b9ba52709fe2c1",
  "operation": "clear_new",
  "success": 0
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

PUThttp://localhost:3000/api/archives/{id}/isnew

Sets/Restores the “New!” flag on an archive.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Responses

200Successful response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/metadata

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

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Responses

200Archive metadata
{
  "arcid": "28697b96f0ac5858be2614ed10ca47742c9522fd",
  "extension": "rar",
  "filename": "Fate GO MEMO",
  "isnew": false,
  "lastreadtime": 1337038281,
  "pagecount": 34,
  "progress": 3,
  "size": 1234567,
  "summary": null,
  "tags": "parody:fate grand order,  group:wadamemo,  artist:wada rco,  artbook,  full color",
  "title": "Fate GO MEMO",
  "toc": [
    {
      "name": "Chapter 1",
      "page": 1
    },
    {
      "name": "Chapter 2",
      "page": 13
    },
    {
      "name": "Chapter 3",
      "page": 25
    }
  ]
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

Your own instance address. Requests go from this browser straight to it.

PUThttp://localhost:3000/api/archives/{id}/metadata

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

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Query parameters

titlestringoptional
New Title of the Archive.
tagsstringoptional
New Tags of the Archive.
summarystringoptional
New Summary of the Archive.

Responses

200Archive metadata updated
{
  "operation": "update_metadata",
  "success": 1
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/page

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

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to download.

Query parameters

pathstringrequired
Path to the image.

Responses

200Archive page

This response carries no example body.

400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

Your own instance address. Requests go from this browser straight to it.

GET /archives/{id}/page-dimensions?count=N — natural pixel width/height for the first N

Section titled “GET /archives/{id}/page-dimensions?count=N — natural pixel width/height for the first N”
GEThttp://localhost:3000/api/archives/{id}/page-dimensions

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/archives.rs:3301), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


GET /archives/{id}/page-dimensions?count=N — natural pixel width/height for the first N pages only, in the same order as /files’s own pages array (so the frontend can zip them together by index without a separate name-matching step). Additive to /files, not folded into it — existing callers of /files (the third-party-compatible file-list contract) shouldn’t have to pay for an archive pass with per-entry image-header parsing they never asked for; only the infinite-scroll reader view (the one caller that actually needs this, to size not-yet-loaded <img>s accurately before jumping to a resume position — see read_page_dimensions’s own docs for why it’s bounded to just the pages before that jump, not the whole archive) calls this endpoint at all.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/archives.rs:226.

This response carries no example body.

Your own instance address. Requests go from this browser straight to it.

DELETE /archives/{id}/patch — deletes the sidecar .patch.zip (if any) and clears the

Section titled “DELETE /archives/{id}/patch — deletes the sidecar .patch.zip (if any) and clears the”
DELETEhttp://localhost:3000/api/archives/{id}/patch

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/archives.rs:1111), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


DELETE /archives/{id}/patch — deletes the sidecar .patch.zip (if any) and clears the archive’s has_patch flag. Lets the user undo a patch — e.g. to replace it with pages from a different source after re-running the comparison flow — without touching the archive itself.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/archives.rs:246.

This response carries no example body.

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

PUThttp://localhost:3000/api/archives/{id}/progress/{page}

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.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.
pageintegerrequired
Current page to update the reading progress to. Must be a positive integer, and inferior or equal to the total page number of the archive.

Responses

200Success response
{
  "id": "75d18ce470dc99f83dc355bdad66319d1f33c82b",
  "lastreadtime": 123943543,
  "operation": "update_progress",
  "page": 34,
  "success": 1
}
400Generic error response
{
  "error": "Server-side Progress Tracking is disabled on this instance.",
  "operation": "update_progress",
  "success": 0
}
401Authentication required when authprogress is enabled
{
  "error": "This operation requires authentication.",
  "operation": "update_progress",
  "success": 0
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

PUT /archives/{id}/rename — additive, no legacy equivalent (legacy has no archive-rename

Section titled “PUT /archives/{id}/rename — additive, no legacy equivalent (legacy has no archive-rename”
PUThttp://localhost:3000/api/archives/{id}/rename

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/archives.rs:1228), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


PUT /archives/{id}/rename — additive, no legacy equivalent (legacy has no archive-rename feature at all; verified via ~/LANraragi/lib/LANraragi/Controller/*.pm and public/js/edit.js having no rename reference anywhere). Renames the archive’s on-disk file (not just its stored title/name), keeping Archive::file and LRR_FILEMAP in sync — modeled on download_manager::ingest’s own staging-file-to-archive_dir rename fixup, the closest existing precedent for “the archive’s file path changed, update the two places that track it”.

A sidecar .patch.zip (see delete_patch’s own docs on how it’s associated — same directory, same stem, purely by filename convention) is renamed alongside the archive itself: leaving it under the old stem would silently break patch::patch_path_for’s lookup for every future request, making an existing patch invisible without deleting anything or erroring — the kind of silent data-loss-adjacent bug that’s much worse than a rename this function could instead just reject outright.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/archives.rs:247.

This response carries no example body.

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/tankoubons

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

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Responses

200Archive tankoubons
{
  "operation": "find_arc_tankoubons",
  "success": 1,
  "tankoubons": [
    "TANK_1688616437",
    "TANK_1688693913"
  ]
}
400No archive ID response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/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.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the archive to process

Query parameters

no_fallbackstring · enum: true | falseoptional
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)
pageinteger · min: 0optional
Specify which page you want to get a thumbnail for. Defaults to the cover, aka page 1.

Responses

200If the thumbnail was already extracted, you get it directly.

This response carries no example body.

202The thumbnail is queued for extraction. Use `/api/minion/:jobid` to track when your thumbnail is ready.
{
  "job": 0,
  "operation": "",
  "success": 1
}
400No archive ID response
{
  "error": "No archive ID specified.",
  "operation": "serve_thumbnail",
  "success": 0
}

Your own instance address. Requests go from this browser straight to it.

PUThttp://localhost:3000/api/archives/{id}/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.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Query parameters

pageintegeroptional
Page you want to make the thumbnail out of. Defaults to 1.

Responses

200Archive thumbnail updated
{
  "new_thumbnail": "",
  "operation": "update_thumbnail",
  "success": 0
}
400No archive ID response
{
  "error": "No archive ID specified.",
  "operation": "update_thumbnail",
  "success": 0
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/{id}/thumbnails

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The handler is get_page_thumbnails in crates/lanrurugi-api/src/archives.rs:3483.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/archives.rs:231.

This response carries no example body.

Your own instance address. Requests go from this browser straight to it.

Remove entry from Archive Table of Contents

Section titled “Remove entry from Archive Table of Contents”
DELETEhttp://localhost:3000/api/archives/{id}/toc

Delete an entry from the Table of Contents of a given Archive.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Query parameters

pageintegerrequired
Page number of the chapter/section to delete.

Responses

200Archive TOC updated
{
  "operation": "remove_toc",
  "success": 1,
  "successMessage": "Removed ToC entry for page 143."
}
400No archive ID response or other error
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

PUThttp://localhost:3000/api/archives/{id}/toc

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.

Path parameters

idstring · min: 40 · max: 40 · patternrequired
ID of the Archive to process.

Query parameters

pageintegerrequired
Page number where the chapter/section starts.
titlestringrequired
Title of the chapter/section.

Responses

200Archive TOC updated
{
  "operation": "update_toc",
  "success": 1,
  "successMessage": "Added ToC entry for page 143."
}
400No archive ID response or other error
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

GEThttp://localhost:3000/api/archives/untagged

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.

Responses

200Array of archive IDs
[
  "d1858d5dc36925aa66be072a97817650d39de166",
  "c3458d5dc36925da93be072a97817650d39de166",
  "28697b96f0ac5858be2614ed10ca47742c9522fd"
]

Your own instance address. Requests go from this browser straight to it.

PUThttp://localhost:3000/api/archives/upload

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.

Request body

multipart/form-data

Responses

200Archive uploaded successfully
{
  "id": "d07ff399dddb25a0408385bc75b9ba52709fe2c1",
  "operation": "upload",
  "success": 1
}
400Bad request
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
409Duplicate archive
{
  "error": "This file already exists in the Library. Enable replace duplicated archive in config to replace old ones.",
  "id": "0b91b546850e881034833c73375558928ddcec7c",
  "operation": "upload",
  "success": 0
}
415Unsupported file
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
417Checksum mismatch
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
422Unprocessable Entity
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
423Locked resource response
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}
500Internal Server Error
{
  "error": "",
  "operation": "",
  "success": 0,
  "successMessage": ""
}

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.