Download

HTTP API reference

Guide The local HTTP API, route by route. The generated contract for every route is in the reference section.

The machine-readable contract is docs/api-contract/. openapi.json there describes every one of the 207 routes: method, path, parameters, and request body. http.md indexes them against the user journeys they serve, with each route’s auth class, whether it streams, the response model it declares, and a one-line purpose. Both are generated from the running app, and a test fails when they drift, so they cannot describe an engine that no longer exists. The tables below are the guided tour of the same surface. Where the two differ, the contract is the one that was checked.

Using it

The engine serves HTTP on 127.0.0.1 only. The background service uses port 8742 unless you set RESMON_DAEMON_PORT; the engine a window starts for itself uses a free port chosen at start. Health › This engine shows the address the window is using, and the port file a running engine writes beside its database names it for a program.

Every request needs the engine’s local API token in Authorization: Bearer <token> and a loopback Host. A request from a browser must also carry the exact origin of resmon’s own renderer. The token is in an owner-only file named api-token-<port> in resmon’s state directory. Refusals are 401 token_missing, 401 token_invalid, 403 host_refused, and 403 origin_refused. See docs/local-api-security.md.

Requests and responses are JSON unless a route says otherwise. An error response is FastAPI’s standard {"detail": "..."}, and a search refused because the engine is already running as many runs as it allows is 429 with a Retry-After: 5 header. Most routes declare a response model, and http.md says which. Three kinds of route stream: a run’s progress, a selected-evidence answer’s events, and a message to the assistant.

Credentials never travel back: a route reports whether one is stored, as present, absent, or unreadable, and never its value.

Health and identity

Who the engine is, and whether this window may talk to it.

MethodPathWhat it does
GET/api/healthLiveness, process identity (the runtime id, process id, and start time), the version, the database schema, and whether the similarity index loaded.
POST/api/renderer/heartbeatA ping from the window, so the engine knows one is present.
POST/api/auth/renderer-originAllow one more exact renderer origin on this engine.

Asking the sources

Starting a Deep Dive or a Deep Sweep, and the catalog they choose from. Both start routes take an optional request_id: two requests with the same one are one submission, and the second is answered with the first’s run and duplicate: true.

MethodPathWhat it does
POST/api/search/diveStart a Deep Dive on one source. Answers with the run’s id at once.
POST/api/search/sweepStart a Deep Sweep on several sources. The cap on papers applies to each source.
GET/api/search/repositoriesThe slugs of the sources this copy of resmon can ask.
GET/api/repositories/catalogThe source catalog: each source’s coverage, key requirement, pace, how it combines terms and dates papers, credit, and whether it can be asked about an author. It never returns a secret.

Runs

Every run, whether you started it or a watch fired it. A run’s progress is read as a list of events or as a server-sent stream.

MethodPathWhat it does
GET/api/executionsOne page of runs, newest first, with each run’s coverage.
GET/api/executions/activeThe ids of runs that are going now.
GET/api/executions/{exec_id}One run: its kind, status, parameters, times, counts, coverage, and the summary connections it tried.
DELETE/api/executions/{exec_id}Delete a run’s record. Its report and log files stay where they were written, and its papers stay in the collection.
POST/api/executions/{exec_id}/cancelAsk a running run to stop at its next checkpoint.
POST/api/executions/{exec_id}/restartStart a fresh run with this one’s parameters, linked back to it. It is not a resume.
GET/api/executions/{exec_id}/reportThe run’s Markdown report.
GET/api/executions/{exec_id}/logThe run’s log text.
GET/api/executions/{exec_id}/search-recordThe complete, dated account of one search, as JSON or Markdown.
GET/api/executions/{exec_id}/documentsOne page of the papers the run stored, each with its stored id and its place in the reading queue.
GET/api/executions/{exec_id}/document-idsEvery paper the run stored that is still in the collection, by id.
GET/api/executions/{exec_id}/referencesExport one run’s papers as BibTeX, RIS, CSV, or JSON. JSON can include stored ids with include_ids=true.
GET/api/executions/{exec_id}/progress/eventsThe run’s events so far, live or as saved after it ended.
GET/api/executions/{exec_id}/progress/streamThe same events as server-sent events, with resumption from a cursor.
GET/api/executions/{exec_id}/deliveriesWhere this run’s report was sent, and the state of each delivery.
GET/api/executions/{exec_id}/bundleOne run’s bundle as bytes: report, log, metadata, and search record.
POST/api/executions/exportWrite the selected runs’ bundle into the export folder and answer with its path.
POST/api/executions/archiveThe same archive, as bytes.

Watches and the schedule

A watch is called a routine in the API. Deactivating one keeps it and stops its schedule; a routine can be run once whatever its state.

MethodPathWhat it does
GET/api/routinesEvery watch.
POST/api/routinesMake a watch. The answer includes entity_warning when it follows a person through sources that cannot be asked about one.
GET/api/routines/{routine_id}One watch, with its next computed dates and its record of missed fires.
PUT/api/routines/{routine_id}Change a watch: its name, schedule, parameters, switches, summaries, or intent.
DELETE/api/routines/{routine_id}Delete a watch and its schedule. Its runs and papers stay.
POST/api/routines/{routine_id}/activatePut the watch on the schedule.
POST/api/routines/{routine_id}/deactivateTake the watch off the schedule without deleting it.
POST/api/routines/{routine_id}/runRun once, now, outside the schedule. At the run limit it is queued and the answer says so; only when the queue is full is it refused.
GET/api/routines/{routine_id}/coverageThe coverage audit: is this watch finding what its intent says, and what is it missing.
GET/api/routines/{routine_id}/documentsThe papers this watch’s runs collected.
GET/api/routines/{routine_id}/delivery-targetsThe watch’s destinations.
POST/api/routines/{routine_id}/delivery-targetsAdd a destination: email, folder, webhook, or feed.
PUT/api/routines/{routine_id}/delivery-targets/{target_id}Change a destination’s mode (automatic or review) or turn it on or off.
DELETE/api/routines/{routine_id}/delivery-targets/{target_id}Remove a destination.
GET/api/routines/{routine_id}/deliveriesThe delivery record for a watch.
GET/api/scheduler/statusWhether each active watch will actually fire, and what decides it.
GET/api/scheduler/jobsThe jobs registered with the scheduler.
GET/api/calendar/eventsPast runs and the fires each active watch’s schedule promises, between two instants.

Delivery

Where a report went, and the three decisions the queue is not allowed to make for you: release, skip, and retry.

MethodPathWhat it does
POST/api/deliveries/{delivery_id}/deliverRelease a delivery that was waiting for review. The only way out of that state.
POST/api/deliveries/{delivery_id}/skipDecide not to send a delivery.
POST/api/deliveries/{delivery_id}/retryStart the attempts again after the backoff has given up.
GET/api/deliveries/{delivery_id}/bundleThe report bundle a webhook envelope linked to, for whoever holds the signed link. The one route served without the local API token.

The background service

MethodPathWhat it does
GET/api/service/statusWhether the service’s unit is installed, where, what it runs, and whether the app is available to run it.
GET/api/service/daemon-statusWhether the service is actually running, read from its lock file.
POST/api/service/installWrite the unit for this platform and, if asked, register it with the system.
POST/api/service/uninstallRemove the unit, and deregister it first if asked.

Saved searches

Saved Deep Dives, saved Deep Sweeps, and the copy kept of every watch. Imports always add rows.

MethodPathWhat it does
GET/api/configurationsEvery saved configuration.
POST/api/configurationsSave a search. link_to_execution_id links it to the run it came from.
PUT/api/configurations/{config_id}Change a saved search.
DELETE/api/configurations/{config_id}Delete one. A watch’s copy takes its watch with it.
POST/api/configurations/exportWrite the chosen rows as a ZIP into the export folder and answer with its path.
POST/api/configurations/archiveThe same archive, as bytes.
POST/api/configurations/importRead ZIP or JSON files and add every entry as a new row. A watch arrives paused.

Today and the map

MethodPathWhat it does
GET/api/todayThe papers first collected since Today was last marked read, by watch, with each watch’s last run.
POST/api/today/lookedMark all read: the next window starts now.
GET/api/mapWhere every paper sits on the plate, the basis it was placed on, and the regions.
GET/api/map/facetsWhat the map’s filters and colors read about every paper: source, dates, reading state, whether it is new, and its watches.
GET/api/map/findPapers whose title or authors contain a string of at least two characters, newest first.
GET/api/map/views/{name}The filters and colors a map (today or run) was last left with.
PUT/api/map/views/{name}Keep a map’s filters and colors.
POST/api/documents/briefsA line about each paper asked for: title, authors, source, and dates.
GET/api/onboardingWhat the first-run card shows, as facts.
POST/api/onboarding/dismissPut the first-run card away for good.

Your collection

Searching what resmon holds, one paper, links between records of the same work, the reading queue, and reference exports.

MethodPathWhat it does
POST/api/explorer/searchSearch the whole collection by words or by meaning, with filters. POST because the filter set is a structure.
POST/api/explorer/facetsThe filter values available under the current filters, with counts.
POST/api/explorer/exportExport everything matching the current filters, not only the page shown.
GET/api/documents/{doc_id}One paper as stored, and its place in the reading queue.
GET/api/documents/{doc_id}/whyWhat is locally verifiable about why a paper is in the collection, and what resmon cannot see.
GET/api/documents/{doc_id}/lifecycleRetractions, concerns, corrections, and newer versions recorded against one paper.
GET/api/documents/{document_id}/similarThe papers nearest one paper, with distances and sources.
GET/api/documents/{document_id}/linksWhat else in the collection looks like the same work.
POST/api/links/for-documentsLinks for a page of results in one round trip.
POST/api/links/collapse-previewWhich of these ids a fold would hide, without folding anything.
POST/api/links/scanFind records that look like the same work across the collection. Returns at once.
POST/api/links/scan/cancelStop the scan after the paper in flight. Links already written are kept.
GET/api/links/statusHow many links exist, by method, and the scan’s state.
GET/api/reading-queueOne page of saved papers, filtered by to_read, read, or all.
POST/api/reading-queueSave a paper. Saving one already saved returns it unchanged.
PUT/api/reading-queue/{document_id}Mark a saved paper read or unread.
DELETE/api/reading-queue/{document_id}Take a paper out of the queue. The paper is not touched.
POST/api/export/referencesRender a selection of papers as BibTeX, RIS, CSV, or JSON, with one entry per stored paper.
GET/api/shared-wordingThe last scan, the scan in progress, and the pairs it found by group.
POST/api/shared-wording/scanCompare every abstract with every other, in the background. Returns at once.
POST/api/shared-wording/scan/cancelStop the scan. The answer stored before it is kept.
GET/api/shared-wording/pairs/{a}/{b}Two abstracts side by side, the passages they share, and the numbers.
GET/api/shared-wording/papers/{document_id}The pairs one paper is in.

People

Watch profiles, which the app calls people. Every match records its basis.

MethodPathWhat it does
GET/api/profilesEvery person.
POST/api/profilesAdd a person.
GET/api/profiles/{profile_id}One person.
PUT/api/profiles/{profile_id}Change a person.
DELETE/api/profiles/{profile_id}Remove a person and their matches. The papers stay.
GET/api/profiles/{profile_id}/matchesPapers matched to a person, each with the basis it matched on.
GET/api/profiles/{profile_id}/lifecycleRetractions and other notices on that person’s papers, with coverage.
GET/api/profiles/{profile_id}/exportA person as JSON.
POST/api/profiles/importImport exported people.
GET/api/profiles/starterThe curated people that ship with the app, not yet anyone’s profile.
POST/api/profiles/matches/for-documentsWhich people matched a page of papers, and on what basis.

Health

The Source wall, the Watchdog, retractions and updates, and analytics.

MethodPathWhat it does
GET/api/coverage/source-wallEvery source’s recorded answer to each of the last limit runs.
GET/api/watchdogFindings, what could not be judged yet, and the thresholds used.
POST/api/watchdog/muteAcknowledge a finding so it stops counting toward the alarm total.
POST/api/watchdog/unmuteReturn a finding to the alarm total.
GET/api/lifecycleRecorded notices, how much of the collection they cover, and the state of a check.
POST/api/lifecycle/checkStart a bounded check of the least recently checked papers.
POST/api/lifecycle/stopAsk a running check to stop before its next request.
POST/api/lifecycle/for-documentsNotices for a page of results in one round trip.
GET/api/analytics/overviewEverything Analytics needs, in one round trip.
GET/api/analytics/summaryThe collection’s summary counts.
GET/api/analytics/source-contributionPer source: papers delivered, and how many nothing else found.
GET/api/analytics/keyword-contributionPer keyword: papers it found that no other keyword did.
GET/api/analytics/discovery-lagMedian days between publication and resmon first seeing each paper.
GET/api/analytics/routine-healthPer watch: new results per run, and whether it has gone quiet.
GET/api/analytics/publication-volumePapers per publication month, by source or by subject category.

Embeddings

Ranking by meaning and placing papers on the map by meaning.

MethodPathWhat it does
GET/api/embeddings/statusHow many papers are embedded with which model, the state of a backfill, the index, and the extension.
GET/api/embeddings/estimateWhat a backfill would cost, before it starts.
POST/api/embeddings/probeAsk the configured or supplied lane to embed one short string.
POST/api/embeddings/backfillEmbed every paper without a vector for the active model.
POST/api/embeddings/backfill/cancelStop after the batch in flight. Vectors already written are kept.
POST/api/embeddings/rebuildRebuild the similarity index from the stored vectors.
GET/api/settings/embeddingsThe stored settings, with everything the Settings group needs to describe each provider honestly.
PUT/api/settings/embeddingsStore the settings. A provider that cannot embed is refused.

The Library

Every Library route needs the header X-Resmon-Library: 1, and a vault id the caller expects. Unavailable on Windows.

MethodPathWhat it does
GET/api/libraryWhether a Library exists, its folder, counts, and limits.
POST/api/library/vaultMake the Library folder inside a folder you name.
GET/api/library/filesFiles, filtered by name, newest first.
POST/api/library/filesImport a file, as raw bytes.
GET/api/library/files/{file_id}One file’s record.
POST/api/library/files/{file_id}/openVerify the stored copy and answer with the path to open.
POST/api/library/files/{file_id}/paper-linksLink a file to a paper by its number.
GET/api/library/files/{file_id}/textA TXT or MD file as literal text, within its bounds.
GET/api/library/files/{file_id}/shared-wordingThe last comparison of this file since the engine started, or that there is none.
POST/api/library/files/{file_id}/shared-wordingCompare this file, page by page, with the abstracts and the other Library files.
GET/api/library/exportA JSON inventory of what the database records about each file.

Evidence

Projects of exact file versions, notes and passages, exports, and selected-evidence answers. These routes use the same Library header.

MethodPathWhat it does
GET/api/evidence/projectsProjects.
POST/api/evidence/projectsStart a project.
GET/api/evidence/projects/{project_id}One project and its revision.
PATCH/api/evidence/projects/{project_id}Rename a project.
GET/api/evidence/projects/{project_id}/filesThe exact file versions a project holds.
POST/api/evidence/projects/{project_id}/filesAdd a file version to a project.
DELETE/api/evidence/projects/{project_id}/files/{file_id}Remove a file from a project. Its saved records stay.
GET/api/evidence/projects/{project_id}/notesThe project’s notes and passages.
POST/api/evidence/projects/{project_id}/notesSave a note or a passage. The engine checks the exact quote against the stored file first.
PATCH/api/evidence/projects/{project_id}/notes/{note_id}Edit a note’s body. The pin never moves.
GET/api/evidence/projects/{project_id}/reader/{file_id}One page of a file, as canonical text.
POST/api/evidence/projects/{project_id}/bundleExport 1 to 20 chosen files and their records as a ZIP.
POST/api/evidence/projects/{project_id}/answer-previewsAssemble and show exactly what a selected-evidence answer would send. Calls no model.
GET/api/evidence/projects/{project_id}/answersThe project’s saved answers.
POST/api/evidence/projects/{project_id}/answersSend a confirmed preview: one new saved answer.
GET/api/evidence/projects/{project_id}/answers/{answer_id}One saved answer.
POST/api/evidence/projects/{project_id}/answers/{answer_id}/cancelStop a running answer.
GET/api/evidence/projects/{project_id}/answers/{answer_id}/eventsA running answer’s events, as server-sent events.
GET/api/evidence/projects/{project_id}/answers/{answer_id}/exportA saved answer as an offline HTML document or a ZIP.

Ask

The assistant, its saved conversations, and the command sign-in checks.

MethodPathWhat it does
GET/api/assistant/statusWhether the assistant can run, and if not, why in one sentence. Also the choices a new conversation offers.
GET/api/assistant/sessionsSaved conversations.
GET/api/assistant/sessions/browseSaved conversations, a page at a time, with a title filter.
POST/api/assistant/sessionsStart a conversation.
GET/api/assistant/sessions/{session_id}One conversation with its messages.
DELETE/api/assistant/sessions/{session_id}Delete a conversation and its messages.
POST/api/assistant/sessions/{session_id}/messagesSend a message. The answer streams back as events.
POST/api/assistant/sessions/{session_id}/cancelStop the running turn.
GET/api/assistant/sessions/{session_id}/exportA saved conversation as Markdown or JSON.
POST/api/assistant/permissionsAsk the person, and hold the request open until they answer. This is the assistant’s permission tool.
POST/api/assistant/permissions/{request_id}The panel’s Allow or Deny.
GET/api/ai/cli/sign-inAsk the claude or codex command itself whether it is signed in. No model call, no cost.
POST/api/ai/cli/sign-inStart the command’s own login in a terminal, or say the command to run.
GET/api/ai/last-answeredWhich model last answered each requested alias, from answers already kept.
POST/api/ai/modelsThe model ids a provider’s credential can access.

Settings and credentials

A credential’s value is never returned. The engine reports only whether one is stored.

MethodPathWhat it does
GET/api/appearanceThe theme and accent.
PUT/api/appearanceStore the theme and accent.
GET/api/settings/aiSummary settings, including the connection chain.
PUT/api/settings/aiStore them.
GET/api/settings/ai/cli-statusWhether each command can be found, and where.
GET/api/settings/assistantWhat a new conversation starts with.
PUT/api/settings/assistantStore it.
GET/api/settings/emailThe mail account, without its password.
PUT/api/settings/emailStore it.
POST/api/settings/email/testSend a test email with the stored settings.
GET/api/settings/notificationsWhen desktop notifications are posted.
PUT/api/settings/notificationsStore it.
GET/api/settings/storageThe export folder, where backups go.
PUT/api/settings/storageStore it.
GET/api/settings/executionHow many runs go at once, and how many watch runs may wait.
PUT/api/settings/executionStore them.
GET/api/credentialsPer credential name: present, absent, or unreadable.
PUT/api/credentials/{key_name}Store a credential in the system keychain.
DELETE/api/credentials/{key_name}Remove a credential.
POST/api/credentials/validateTry a key against its provider: accepted, refused, unanswered, unreachable, or untestable.

Backup and restore

A restore is staged and runs the next time an engine starts.

MethodPathWhat it does
POST/api/backupWrite one bundle: the snapshotted database, the Library’s bytes, and optionally the reports.
GET/api/backup/lastThe last bundle, the last restore’s outcome, a staged restore, and whether an undo copy exists.
POST/api/backup/verifyRecompute every hash in a bundle and report what a restore would and would not do.
POST/api/backup/drive-upload-notice/acknowledgeDismiss the Backup page’s one-time notice about Google Drive.
POST/api/restoreVerify a bundle and stage it.
POST/api/restore/cancelForget a staged restore. Nothing had been moved.
POST/api/restore/acknowledgeDismiss the one-time card listing the credentials to enter again.
POST/api/restore/undo-copy/deleteDelete the copies a restore set aside. Irreversible, so it needs CONFIRM.

The Danger zone

Each takes {"confirm": "CONFIRM"} except the two that erase only keys.

MethodPathWhat it does
POST/api/admin/erase-ai-keysErase every AI provider key.
POST/api/admin/erase-repo-keysErase every source key.
POST/api/admin/erase-configsErase every saved search and every watch linked to one.
POST/api/admin/erase-executionsErase every run and the run counter. Papers are kept.
POST/api/admin/erase-corpusErase every paper. Runs, watches, settings, and keys are kept.
POST/api/admin/erase-execution-dataErase all configs and all runs. Settings and keys are kept.
POST/api/admin/erase-app-dataErase the papers, saved searches, runs, and every key.
POST/api/admin/reset-settingsReset every setting and erase every key. Saved searches and runs are kept.
POST/api/admin/factory-resetErase every key, saved search, run, paper, and setting. The Library is kept.