{"components":{"schemas":{"ActorItem":{"properties":{"actorId":{"type":"integer"},"actorType":{"type":"string"},"dokumentRolle":{"description":"The actor's role on the document.","type":"string"},"gruppenavnkort":{"description":"Party short name, if any.","type":["string","null"]},"navn":{"type":"string"},"personNavn":{"type":["string","null"]}},"required":["actorId","navn","actorType","dokumentRolle"],"type":"object"},"Application":{"description":"An application for full access (Phase 55). `note` is Anders's, with a rejection.","properties":{"createdAt":{"format":"date-time","type":"string"},"decidedAt":{"format":"date-time","type":["string","null"]},"note":{"type":["string","null"]},"state":{"enum":["waiting","approved","rejected"],"type":"string"}},"required":["state","createdAt","decidedAt","note"],"type":"object"},"CapCode":{"description":"A CAP policy-area code. NOTE: snake_case keys.","properties":{"cap_code":{"description":"Use as the `capCodes` filter value.","type":"string"},"count":{"type":["integer","null"]},"major_code":{"type":"string"},"major_title":{"type":"string"},"minor_code":{"type":"string"},"title":{"type":"string"}},"required":["cap_code","major_code","minor_code","major_title","title"],"type":"object"},"CapCodeCompressed":{"description":"A document's CAP classification. NOTE: snake_case keys.","properties":{"cap_code":{"type":"string"},"rank":{"description":"1 = closest CAP category (up to 5).","type":"integer"},"similarity":{"description":"Cosine similarity to the CAP category (0..1).","type":"number"}},"required":["cap_code"],"type":"object"},"CaseDetail":{"properties":{"appendix":{"description":"Case documents not attached to any of the case's steps. A true set difference against `steps`, so no document appears in both.","items":{"$ref":"#/components/schemas/CaseDocument"},"type":"array"},"lovnummer":{"type":"string"},"nummer":{"type":"string"},"nummerPrefix":{"description":"With `nummer`, forms the case number, e.g. \"L 25\".","type":"string"},"periode":{"type":"string"},"retsinformationsUrl":{"type":"string"},"sagId":{"type":"integer"},"sagsStatus":{"type":"string"},"sagsType":{"type":"string"},"steps":{"description":"The case timeline, oldest first, undated steps last. Steps with no documents are included: they are milestones, not an error state, and most steps have none.","items":{"$ref":"#/components/schemas/CaseStep"},"type":"array"},"titel":{"type":"string"},"titelKort":{"type":"string"},"totalDocuments":{"description":"Distinct documents in the whole case. Equals the documents in the payload unless `truncated`, when it is the full count behind the cut.","type":"integer"},"truncated":{"description":"The document cap was hit and the payload was cut short.","type":"boolean"}},"required":["sagId","titel","titelKort","sagsType","sagsStatus","steps","appendix"],"type":"object"},"CaseDocument":{"properties":{"answers":{"description":"For a question: its answers. One question can have several (supplerende besvarelser), up to six.","items":{"$ref":"#/components/schemas/QuestionRef"},"type":"array"},"bilagsnummer":{"type":"string"},"dokumentId":{"description":"The identity of the node. Always present.","type":"integer"},"dokumentType":{"description":"e.g. Bilag, Svar, Spørgsmål. Used to group the appendix.","type":"string"},"filId":{"description":"Absent when the document has no file.","type":"integer"},"filUrl":{"description":"Only ever present when `hasFile` is true.","type":"string"},"fileAlternatives":{"$ref":"#/components/schemas/FileAlternatives"},"hasFile":{"description":"Roughly one case document in three has no file. Never render an open-file affordance when this is false.","type":"boolean"},"isRequested":{"description":"This is the document the request was made about.","type":"boolean"},"question":{"$ref":"#/components/schemas/QuestionRef"},"titel":{"type":"string"}},"required":["dokumentId","titel","dokumentType","hasFile"],"type":"object"},"CaseFile":{"properties":{"filId":{"type":"integer"},"format":{"type":"string"},"url":{"type":"string"}},"required":["filId","format","url"],"type":"object"},"CaseOverviewResponse":{"properties":{"case":{"oneOf":[{"$ref":"#/components/schemas/CaseDetail"},{"type":"null"}]},"cases":{"description":"Every case this file belongs to, most recently updated first. Empty when the document has no case.","items":{"$ref":"#/components/schemas/CaseSummary"},"type":"array"},"requestedFilId":{"description":"Echoed back when the request came in by fil.","type":"integer"},"selectedSagId":{"description":"Which case is expanded in `case`.","type":["integer","null"]}},"required":["cases","selectedSagId","case"],"type":"object"},"CaseRef":{"properties":{"caseCount":{"description":"How many distinct cases the document belongs to.","type":"integer"},"nummer":{"description":"Case number, e.g. \"L 128\" or \"KEF alm. del\".","type":["string","null"]},"nummerPrefix":{"description":"Prefix such as \"L\"; prepend it when `nummer` does not already start with it.","type":["string","null"]},"sagId":{"description":"For GET /api/cases/{sagId}.","type":"integer"},"sagsType":{"description":"Case type, e.g. \"Lovforslag\".","type":"string"},"titelKort":{"description":"The case's short title.","type":["string","null"]}},"required":["sagId","sagsType","caseCount"],"type":"object"},"CaseStep":{"properties":{"dato":{"format":"date-time","type":["string","null"]},"documents":{"items":{"$ref":"#/components/schemas/CaseDocument"},"type":"array"},"sagstrinId":{"type":"integer"},"titel":{"type":"string"},"type":{"description":"The raw step-type label, e.g. \"1. behandling\".","type":"string"},"typeNormalised":{"description":"The label lowercased and stripped of a trailing dot. Step-type labels are duplicated across ids (7 share \"Udvalgsbehandling\", and \"1. behandling.\" is a separate id from \"1. behandling\"), so filters must key on this, not on an id.","type":"string"}},"required":["sagstrinId","titel","type","typeNormalised","documents"],"type":"object"},"CaseSummary":{"properties":{"opdateringsdato":{"format":"date-time","type":"string"},"sagId":{"type":"integer"},"sagsStatus":{"description":"e.g. Stadfæstet, Vedtaget, Forkastet.","type":"string"},"sagsType":{"description":"e.g. Lovforslag, § 20-spørgsmål.","type":"string"},"titelKort":{"type":"string"}},"required":["sagId","titelKort","sagsType","sagsStatus","opdateringsdato"],"type":"object"},"DocumentType":{"properties":{"count":{"type":"integer"},"labelDa":{"type":"string"},"labelEn":{"type":"string"},"value":{"description":"Use as the `documentTypes` filter value.","type":"string"}},"required":["count","value","labelDa","labelEn"],"type":"object"},"EmneordItem":{"properties":{"emneord":{"type":"string"},"emneordType":{"type":"string"}},"required":["emneord","emneordType"],"type":"object"},"Error":{"description":"Every error response (backend Phase 35). Branch on `code`; `message` is for people.","properties":{"error":{"properties":{"code":{"enum":["bad_request","unauthorized","not_found","timeout","unavailable","internal","payload_too_large","rate_limited","export_quota","snippet_quota","export_allowance","application_waiting","already_approved","email_not_allowed","email_plus_address","theme_too_short","theme_limit","api_key_limit","already_subscribed","no_subscription","subscription_required","no_draft","draft_quota"],"type":"string"},"message":{"type":"string"},"status":{"description":"The HTTP status, repeated.","type":"integer"}},"required":["status","code","message"],"type":"object"},"retryAfterSeconds":{"description":"On a 429: wait this long.","type":"integer"}},"required":["error"],"type":"object"},"FileAlternatives":{"description":"Present only when the document has more than one file. About 18% do. An answer's attachments are extra files on the same document, so a client that only shows the count hides them.","properties":{"count":{"description":"Files BESIDES the primary one.","type":"integer"},"files":{"description":"The other files, PDF first. Files with no URL are omitted.","items":{"$ref":"#/components/schemas/CaseFile"},"type":"array"},"formats":{"items":{"type":"string"},"type":"array"}},"required":["count","formats","files"],"type":"object"},"Me":{"description":"The logged-in account (Phase 51).","properties":{"application":{"description":"The account's newest application for full access (Phase 55), or null.","oneOf":[{"$ref":"#/components/schemas/Application"},{"type":"null"}]},"email":{"type":"string"},"kind":{"enum":["user","approved","blocked"],"type":"string"},"language":{"enum":["da","en"],"type":"string"},"subscription":{"description":"What the account pays for (Phase 58). `paid` says whether it may have the digests now: a failed payment or a cancellation ends that at `paidUntil`, not at once.","properties":{"paid":{"type":"boolean"},"paidUntil":{"format":"date-time","type":["string","null"]},"status":{"enum":["none","active","past_due","canceled"],"type":"string"}},"required":["status","paidUntil","paid"],"type":"object"},"usage":{"properties":{"exportRowsLeft":{"description":"What is left of the account's export rows: of the 1,000 an account has until it is approved, or of an approved account's 30,000 this month (Phase 84).","type":"integer"},"today":{"properties":{"exportRows":{"type":"integer"},"snippetPages":{"type":"integer"}},"type":"object"}},"type":"object"}},"required":["email","kind","language","usage","application","subscription"],"type":"object"},"PageRequest":{"properties":{"offset":{"description":"Index into the ranked set.","minimum":0,"type":"integer"},"queryHash":{"description":"From a prior POST /api/search response.","type":"string"}},"required":["queryHash","offset"],"type":"object"},"PageResponse":{"properties":{"executionTimeMs":{"type":"integer"},"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array"}},"required":["results","executionTimeMs"],"type":"object"},"Profile":{"description":"Who the weekly analysis is written for (Phase 59). `state` is `drafting`, `drafted`, `failed` or `accepted`; only `accepted` is ever used, and it stays in use while a new draft is on its way.","properties":{"accepted":{"type":["string","null"]},"description":{"type":"string"},"draft":{"type":["string","null"]},"state":{"enum":["drafting","drafted","failed","accepted"],"type":"string"},"updatedAt":{"format":"date-time","type":"string"},"website":{"type":["string","null"]}},"required":["description","website","draft","accepted","state","updatedAt"],"type":"object"},"QuestionRef":{"properties":{"dokumentId":{"type":"integer"},"filId":{"type":"integer"},"hasFile":{"type":"boolean"},"ordlyd":{"description":"The question text, carried inline so it can be shown even when the counterpart has no file.","type":"string"},"titel":{"type":"string"}},"required":["dokumentId","titel","hasFile"],"type":"object"},"SearchRequest":{"properties":{"actorName":{"description":"Filter by an actor's name (substring).","type":"string"},"actorNames":{"description":"Actor names, by family (Phase 46): a document matches when any of its actors is in the family of one of them (OR), so a ministry's name also finds its minister's documents, and any member's name selects the whole family. Case, commas and spacing don't matter. Unlike `actorName`, no substring match: [\"justitsminis\"] matches nothing. Values come from the stats endpoint's `byActor`.","items":{"type":"string"},"type":"array"},"actorTypeId":{"description":"Filter by actor type id.","type":"integer"},"addedBefore":{"description":"... and before this time (Phase 72).","format":"date-time","type":"string"},"addedSince":{"description":"Documents that became searchable at or after this time (Phase 72), the weekly mail's \"only the new documents\". A filter in every mode.","format":"date-time","type":"string"},"capCodes":{"description":"Restrict to these CAP `cap_code`s (see /api/cap-codes).","items":{"type":"string"},"type":"array"},"caseSensitive":{"default":false,"description":"Exact mode only.","type":"boolean"},"dateFrom":{"description":"ISO 8601 lower bound (inclusive).","format":"date-time","type":"string"},"dateTo":{"description":"ISO 8601 upper bound (inclusive).","format":"date-time","type":"string"},"documentTypes":{"description":"Restrict to these document-type `value`s (see /api/document-types). \"Svar\" no longer includes the preliminary answers, which are \"Foreløbigt svar\" (Phase 43).","items":{"type":"string"},"type":"array"},"dokumentKategorier":{"description":"Folketinget's own document category, e.g. [\"Samrådsspørgsmål\"] or [\"§ 20-spørgsmål\"] (OR). Matched on the normalised label (trimmed, lower-cased, trailing dots dropped), so a label that exists under two ids (\"Andet\", \"Diverse\", \"Meddelelse\", \"Redegørelse\", \"Referat\") matches both. For answers the category is their status (\"Endeligt svar\"), not the question type.","items":{"type":"string"},"type":"array"},"emneordQuery":{"description":"Filter by keyword (emneord).","type":"string"},"excludedSagstrinTypes":{"description":"Leave out documents attached to a step of these types (`sagstrinstype.type`, normalised like `sagstrinTypes`), e.g. [\"Lovforslag som fremsat\", \"Lovforslag som vedtaget\"]: the documents about a finance bill without its own texts, which keeps the three finance presets apart (Phase 41). Omit for no filter.","items":{"type":"string"},"type":"array"},"limit":{"default":1000,"description":"Max documents to rank/return (the top-K). Higher = slower.","maximum":20000,"minimum":1,"type":"integer"},"mode":{"enum":["semantic","exact","browse"],"type":"string"},"modelKey":{"description":"Optional UMAP model key (advanced).","type":"string"},"query":{"description":"The search text. Required (must be non-empty for `semantic`).","type":"string"},"sagIds":{"description":"Documents in any of these cases (sag.id), OR. Browse over one case and export its queryHash to download the whole case.","items":{"type":"integer"},"type":"array"},"sagsStatuses":{"description":"Case outcomes, e.g. [\"Vedtaget\"]. Also matched on the normalised label: \"Vedtaget\", \"Forkastet\" and \"Anmeldt\" are three ids each. Take values from `GET /api/sag-statuses`. Note this is `sagsstatus`, not `afgørelsesresultatkode`, which is null on 95% of cases.","items":{"type":"string"},"type":"array"},"sagsTypes":{"description":"Case types, e.g. [\"Lovforslag\"]. Matches `sagstype.type`. Take values from `GET /api/sag-types`.","items":{"type":"string"},"type":"array"},"sagstrinScope":{"description":"How `sagstrinTypes` is read. `case` (default) = documents in a case that reached the step; `document` = documents attached to the step itself, which is what the adopted-bill and consultation searches need; `latest` = `document`, but only each case's newest text at those steps that has a searchable file, with the steps listed oldest first (the `bills` preset).","enum":["case","document","latest"],"type":"string"},"sagstrinTypes":{"description":"Case-step labels, e.g. [\"3. behandling\"]. Matched on the NORMALISED label, so one value covers every id sharing it: 7 ids share \"Udvalgsbehandling\" and \"1. behandling.\" is a separate id from \"1. behandling\". Take values from `GET /api/sagstrin-types`.","items":{"type":"string"},"type":"array"},"sort":{"default":"relevance","description":"`relevance` ranks by score. `recent` returns the newest searchable documents first, ordered on the file's update timestamp, and works with `mode: browse` and an empty query: that combination is the landing state. Omitting this field changes nothing.","enum":["relevance","recent"],"type":"string"},"statsbudgetsag":{"description":"State-budget cases (`sag.statsbudgetsag`): every finance bill (finanslov), supplementary appropriation bill (tillægsbevillingslov) and their consequence bills. The Folketing's own flag, not a title match. `true` keeps only their documents, `false` leaves them out. Omit for no filter.","type":"boolean"},"threshold":{"description":"Semantic mode, optional: drop results below this cosine similarity. Omit it (the default) to get the ranked top-K (`limit`) with no cutoff. Short queries score low everywhere, so a fixed cutoff can empty them: \"abort\" returned nothing at the old 0.5 default.","maximum":1,"minimum":0,"type":"number"},"titlesOnly":{"default":false,"description":"Exact mode only: match document titles, case titles and case numbers, and skip the page text. \"L 25\" then returns that bill rather than every file mentioning the string. Results come back newest first and carry no hitCount.","type":"boolean"},"years":{"description":"Documents dated in any of these calendar years (OR), e.g. [2015, 2020] without the years between. Combines with dateFrom/dateTo (AND).","items":{"type":"integer"},"type":"array"}},"required":["query","mode"],"type":"object"},"SearchResponse":{"properties":{"capMajorDistribution":{"additionalProperties":{"type":"integer"},"description":"Map of major CAP code → document count over the result set.","type":"object"},"executionTimeMs":{"type":"integer"},"histogramApproximate":{"type":"boolean"},"message":{"description":"Human-readable status line. Its wording may change; do not parse it. An empty semantic result with no threshold means the filters matched nothing, never that every score was too low.","type":["string","null"]},"queryHash":{"description":"Handle for POST /api/search/page.","type":"string"},"results":{"description":"First page only; page further via /api/search/page.","items":{"$ref":"#/components/schemas/SearchResult"},"type":"array"},"similarityHistogram":{"deprecated":true,"description":"Deprecated: scores in 0.05 bands over the ranked set. It described results against a cutoff that is no longer applied by default, and the Archivum frontend no longer reads it. Still sent for existing API consumers; it will be removed later.","items":{"$ref":"#/components/schemas/SimilarityBucket"},"type":["array","null"]},"timeSeries":{"items":{"$ref":"#/components/schemas/TimeSeriesEntry"},"type":"array"},"totalApproximate":{"description":"true = totalCount is a top-K estimate, not an exact count.","type":"boolean"},"totalCount":{"description":"Size of the ranked set you can page through. In semantic mode without a threshold that is the top-K (`limit`), not a count of documents that match; a top-K estimate when totalApproximate=true.","type":"integer"},"typeDistribution":{"additionalProperties":{"type":"integer"},"description":"Map of document type → document count over the result set.","type":"object"}},"required":["queryHash","totalCount","totalApproximate","executionTimeMs","timeSeries","histogramApproximate","capMajorDistribution","typeDistribution","results"],"type":"object"},"SearchResult":{"properties":{"bestPage":{"description":"Page-level semantic: best-matching page.","type":["integer","null"]},"capCodes":{"items":{"$ref":"#/components/schemas/CapCodeCompressed"},"type":"array"},"case":{"anyOf":[{"$ref":"#/components/schemas/CaseRef"},{"type":"null"}],"description":"The document's primary case (the newest, the one GET /api/cases/by-fil/{filId} opens first), or null when it belongs to none."},"date":{"format":"date-time","type":"string"},"documentType":{"type":"string"},"emneord":{"items":{"$ref":"#/components/schemas/EmneordItem"},"type":"array"},"filId":{"description":"Document (fil) id.","type":"integer"},"hitCount":{"description":"Exact mode only.","type":["integer","null"]},"kind":{"description":"What the document is: the id of the most specific curated filter (GET /api/presets) that holds it, in the order adoptedFinanceActs, financeBillsAsIntroduced, passedLaws, billReports, section20Answers, committeeAnswers, consultationQuestions, allQuestions, financeBills; null when none does.","type":["string","null"]},"longAnswer":{"description":"An answer (kind section20Answers, committeeAnswers or allQuestions) of more than 20 pages: it encloses a report.","type":"boolean"},"pageCount":{"description":"Pages in the document.","type":"integer"},"score":{"description":"Semantic: cosine similarity 0..1. Exact: hit count.","type":"number"},"sourceUrl":{"description":"Public deep link (ft.dk / retsinformation.dk).","type":"string"},"title":{"type":"string"}},"required":["filId","title","date","documentType","sourceUrl","score","case","kind","pageCount","longAnswer","actors","emneord","capCodes"],"type":"object"},"SimilarityBucket":{"properties":{"bucket":{"description":"Lower bound of the 0.05-wide similarity band, e.g. \"0.50\".","type":"string"},"count":{"type":"integer"}},"required":["bucket","count"],"type":"object"},"Theme":{"description":"A saved theme (Phase 57). `filters` is what a search's request narrows by; `alerts` says whether digests may use it.","properties":{"alerts":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"description":{"type":"string"},"filters":{"type":"object"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"summaries":{"description":"Whether the weekly mail carries AI summaries for it (Phase 68): the account's free theme, its pick or else its oldest with mails on, or every theme with mails on once paid for.","type":"boolean"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","name","description","filters","alerts","summaries","createdAt","updatedAt"],"type":"object"},"TimeSeriesEntry":{"properties":{"bucket":{"description":"Year.","type":"string"},"count":{"type":"integer"}},"required":["bucket","count"],"type":"object"}},"securitySchemes":{"apiKey":{"description":"An API key made on the account page (Phase 90), for the routes that read documents for an account: a passage, a whole page, an export and `GET /api/me`, under the account's own limits. A key never changes the account.","scheme":"bearer","type":"http"}}},"info":{"contact":{"name":"Aros Tech","url":"https://archivum.arostech.dk"},"description":"JSON API for semantic, exact, and browse search over the Archivum corpus of Danish parliamentary (Folketinget) and legal (Retsinformation) documents. The search, document and lookup routes are public and need no key. An account gives more (passages, exports, the whole page, Dokumentagenter): it logs in by a link mailed to it, and its session cookie counts only on requests from Archivum's own site, so these routes can't be called with it from here or from a script. A few operator routes need the deployment key.\n\n## Latency\nSemantic search is compute-heavy. At the default `limit` (1000) expect roughly **12–18 seconds**; at `limit=10000` up to **~60 seconds**. Set generous client timeouts. `POST /api/search/page` (pagination over a cached result) is fast.\n\n## Approximate counts\nWhen `totalApproximate` is `true`, `totalCount` is a **top-K estimate**, not an exact match count — the semantic path returns a ranked top-K rather than scanning the whole corpus. `histogramApproximate` means the similarity histogram is likewise over the returned top-K.\n\n## Rate limits\nBudgets are per client IP. `POST /api/search` costs one token per 1,000 requested results (`limit`, so 1 to 20) from a default budget of 120 per minute, burst 60. `POST /api/export` allows 10 per minute, burst 5, and every other route 600 per minute, burst 300. Past the budget the API answers **429** with a `Retry-After` header in seconds and `retryAfterSeconds` in the body: wait that long, then retry. Prefer a smaller `limit` over many large searches.\n\n## Errors\nEvery error answers `{ \"error\": { \"status\", \"code\", \"message\" } }` (schema `Error`). Branch on `code`: `bad_request`, `unauthorized`, `not_found`, `timeout`, `unavailable`, `internal`, `payload_too_large`, `rate_limited`, `export_quota`, `snippet_quota`, `export_allowance`, `application_waiting`, `already_approved`, `email_not_allowed`, `email_plus_address`, `theme_too_short`, `theme_limit`, `already_subscribed`, `no_subscription`, `subscription_required`, `no_draft`, `draft_quota`. The message is for people and may change; an `internal` error never carries the server's own detail.\n\n## Bulk access\nThe API serves research, not bulk extraction. Exports need an account. One Anders hasn't approved gets metadata and each document's best passage, up to **1,000 rows in all**, as a zip with a note beside the file (**403**, code `export_allowance`, once they are used); an approved account gets the full text of up to **30,000 files a month**, counted by the calendar month in UTC (**429**, code `export_quota`, until the first of next month). A program uses an account with an API key made on the account page, sent as `Authorization: Bearer`. Every export is a zip: the file beside `LAES-MIG.txt` or `README.txt`, which says what each column holds and how to cite Archivum. Page snippets need an account, and are served only for documents in the search's own results; an account Anders hasn't approved reads them from 500 pages a day (**429**, code `snippet_quota`, until midnight UTC). Larger extracts, or the whole corpus, are by arrangement: email anders@arostech.dk.","title":"Archivum Search API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/applications":{"post":{"description":"Needs a session. Must be `application/json` from Archivum's own origin. Every field is trimmed and required: `name` and `institution` at most 200 characters, `purpose` and `expectedUse` at most 2,000 (400 otherwise). Anders gets a mail with the application and a receipt goes to the account; he decides with `archivum-users review`, which mails the answer. 409 `application_waiting` while one waits, 409 `already_approved` for an approved account. A rejected account may apply again. `GET /api/me`'s `application` is the newest one.","operationId":"applyForFullAccess","requestBody":{"content":{"application/json":{"schema":{"properties":{"expectedUse":{"maxLength":2000,"type":"string"},"institution":{"maxLength":200,"type":"string"},"name":{"maxLength":200,"type":"string"},"purpose":{"maxLength":2000,"type":"string"}},"required":["name","institution","purpose","expectedUse"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}},"description":"Waiting for Anders."}},"summary":"Apply for full access (Phase 55)"}},"/api/auth/link":{"post":{"description":"Always 204, at once, whether or not the address has an account: the link is mailed from the background, and the account is made only when the link is used (`POST /api/auth/session`). The link is `https://archivum.arostech.dk/log-ind#token=…`, single use, valid 30 minutes. At most five links an address an hour; a blocked account gets none. A disposable address is 400 `email_not_allowed` (Phase 56), one with a plus tag 400 `email_plus_address` (Phase 56b). Must be `application/json` from Archivum's own origin (403 otherwise). Draws on the login budget (429).","operationId":"requestLoginLink","requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"format":"email","type":"string"},"language":{"description":"The mail's language; Danish when left out.","enum":["da","en"],"type":"string"}},"required":["email"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Taken; a mail follows if it may."}},"summary":"Mail a login link to an address (Phase 51)"}},"/api/auth/logout":{"post":{"operationId":"logout","responses":{"204":{"description":"Logged out."}},"summary":"End the session and clear the cookie (Phase 51)"}},"/api/auth/session":{"post":{"description":"Sets `archivum_session` (HttpOnly, Secure, SameSite=Lax, Path=/api, 30 days, renewed while in use) and answers with the account, made here on the address's first login. 401 when the token is unknown, used or expired, or the account is blocked.","operationId":"startSession","requestBody":{"content":{"application/json":{"schema":{"properties":{"token":{"type":"string"}},"required":["token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"description":"Logged in."}},"summary":"Trade a link's token for a session cookie (Phase 51)"}},"/api/billing/checkout":{"post":{"description":"Needs a session; state-change rule. `url` is Stripe's Checkout page for the one price, 69 kr a month plus moms (86,25 kr with it), Stripe Tax adding the moms. `startNow` is the reader asking for the service to begin at once, inside the right of withdrawal: it must be true (400 otherwise), and when it was given is kept on the subscription at Stripe. 409 `already_subscribed` while the account is paid for, 503 where Stripe isn't set up.","operationId":"startCheckout","requestBody":{"content":{"application/json":{"schema":{"properties":{"startNow":{"type":"boolean"}},"required":["startNow"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"}}},"description":"Where the reader pays."}},"summary":"Subscribe to the AI digests (Phase 58)"}},"/api/billing/portal":{"post":{"description":"Needs a session; state-change rule. 409 `no_subscription` for an account Stripe doesn't know.","operationId":"openBillingPortal","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"}}},"description":"Where the reader manages it."}},"summary":"Stripe's portal: cancelling and changing the card (Phase 58)"}},"/api/cap-codes":{"get":{"description":"The Comparative Agendas Project (CAP) policy-area codes available for the `capCodes` filter on `POST /api/search`, with per-code document counts. Use the `cap_code` field as the `capCodes` filter value. **Note:** this schema is snake_case (unlike most of the API).","operationId":"capCodes","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CapCode"},"type":"array"}}},"description":"All CAP codes with counts."}},"summary":"List CAP policy-area codes (filter reference)"}},"/api/cases/by-fil/{filId}":{"get":{"description":"Turns a search hit into the case around it: the `sagstrin` timeline, the documents at each step, every other document in the case, and the question/answer pairs.\n\nA file can belong to several cases, so `cases` lists them all and the most recently updated one is expanded into `case`. Pass `sagId` to expand a different one; a `sagId` the file does not belong to is a 400.\n\nA document with **no** case is a normal `200` with `cases: []` and `case: null`. That is common, not an error.\n\n`hasFile` is explicit on every document node and `filUrl` is only ever present alongside it: roughly one case document in three has no file at all, so never assume one exists.","operationId":"getCaseOverviewByFil","parameters":[{"description":"The fil id from a search result.","in":"path","name":"filId","required":true,"schema":{"type":"integer"}},{"description":"Expand this case instead of the most recent one.","in":"query","name":"sagId","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseOverviewResponse"}}},"description":"The case overview. `case` is null when the document has no case."},"400":{"description":"`sagId` given, but the file does not belong to it."}},"summary":"The case a document belongs to, with its timeline"}},"/api/cases/{sagId}":{"get":{"description":"The same payload as `/api/cases/by-fil/{filId}`, addressed by case instead. `cases` is empty and nothing is marked `isRequested`, because no particular document was asked about.","operationId":"getCaseOverview","parameters":[{"in":"path","name":"sagId","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseOverviewResponse"}}},"description":"The case overview."},"404":{"description":"No such case."}},"summary":"A case by its own id"}},"/api/document-types":{"get":{"description":"The document types available for the `documentTypes` filter on `POST /api/search`, with per-type document counts and Danish/English labels. Use the `value` field as the `documentTypes` filter value. \"Foreløbigt svar\" is not an ODA type: an answer in ODA's category \"Foreløbigt svar\" (a letter saying the answer will follow) is shown and filtered as that, apart from \"Svar\" (Phase 43).","operationId":"documentTypes","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DocumentType"},"type":"array"}}},"description":"All document types with counts and labels."}},"summary":"List document types (filter reference)"}},"/api/documents/{filId}/actors":{"get":{"description":"Who is on the document, and in what role. Since Phase 32 a search response does NOT carry `actors`: they were the slowest part of assembling a 400-row page and nothing reads them until a row is opened, so they are fetched per document instead. An unknown `filId` or a document with no actors both answer `[]`.","operationId":"getDocumentActors","parameters":[{"in":"path","name":"filId","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ActorItem"},"type":"array"}}},"description":"The document's actors, possibly empty."}},"summary":"The actors on one document"}},"/api/documents/{filId}/pages/{page}/text":{"get":{"description":"The whole page behind a search's passage, with every hit marked in exact mode (character offsets into `text`). Only for an account Anders has approved (401 without an account, 403 for one he hasn't approved), one page a request, only for a document in the search's own results (404 otherwise), and on its own per-minute budget (429). Needs the session cookie, from Archivum's own site.","operationId":"getPageText","parameters":[{"in":"path","name":"filId","required":true,"schema":{"type":"integer"}},{"in":"path","name":"page","required":true,"schema":{"type":"integer"}},{"in":"query","name":"queryHash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"filId":{"type":"integer"},"matches":{"items":{"properties":{"end":{"type":"integer"},"start":{"type":"integer"}},"type":"object"},"type":"array"},"mode":{"type":"string"},"page":{"type":"integer"},"queryHash":{"type":"string"},"text":{"description":"Null when the page has no extracted text.","type":["string","null"]}},"required":["filId","page","queryHash","mode","text","matches"],"type":"object"}}},"description":"The page."}},"security":[{"apiKey":[]}],"summary":"One whole page's text, for an approved account (Phase 54)"}},"/api/documents/{filId}/snippets":{"post":{"description":"For a session or an API key. 500 pages a day until the account is approved (**429**, code `snippet_quota`). **404** for a file outside the search's results.","operationId":"getSnippets","parameters":[{"in":"path","name":"filId","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"pages":{"items":{"type":"integer"},"type":"array"},"queryHash":{"type":"string"}},"required":["queryHash","pages"],"type":"object"}}},"required":true},"responses":{"200":{"description":"`{ snippets }`, one per page."},"401":{"description":"Neither a session nor a valid API key."}},"security":[{"apiKey":[]}],"summary":"Passages from pages of a search's own results (Phase 52)"}},"/api/export":{"post":{"description":"For a session or an API key. A zip with the CSV or JSON, one row or object per file, beside a note on what each column holds and how to cite Archivum. An account's limits are in the bulk-access section above.","operationId":"export","requestBody":{"content":{"application/json":{"schema":{"properties":{"format":{"enum":["csv","json"],"type":"string"},"queryHash":{"type":"string"}},"required":["queryHash","format"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/zip":{"schema":{"format":"binary","type":"string"}}},"description":"The zip."},"401":{"description":"Neither a session nor a valid API key."}},"security":[{"apiKey":[]}],"summary":"A search's results as a zip (Phases 53, 86)"}},"/api/export/size":{"get":{"operationId":"exportSize","parameters":[{"in":"query","name":"queryHash","required":true,"schema":{"type":"string"}},{"in":"query","name":"format","required":true,"schema":{"enum":["csv","json"],"type":"string"}}],"responses":{"200":{"description":"`{ bytes, rows, rowsLeft }`."},"401":{"description":"Neither a session nor a valid API key."}},"security":[{"apiKey":[]}],"summary":"What an export would hold for this account (Phase 53)"}},"/api/me":{"delete":{"description":"A deletion request under the GDPR, its applications included. Must be `application/json` from Archivum's own origin.","operationId":"deleteMe","responses":{"204":{"description":"Deleted; the cookie is cleared."}},"summary":"Delete the account and everything tied to it (Phase 51)"},"get":{"description":"401 without a session or a valid API key; with a cookie, 403 from a foreign origin. With a session, sets the cookie again, so it lasts while in use.","operationId":"getMe","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"description":"The account."}},"security":[{"apiKey":[]}],"summary":"The logged-in account (Phase 51)"}},"/api/presets":{"get":{"description":"The app's curated filters (Phase 41), one definition for the backend and the frontend: each preset's `SearchRequest` fields, in its group (`laws`, `questions`, `financeBills`). Empty lists and `false` set nothing. The three finance presets never overlap. Labels live in the frontend. Cached for an hour.","operationId":"listPresets","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"presets":{"items":{"properties":{"documentTypes":{"items":{"type":"string"},"type":"array"},"dokumentKategorier":{"items":{"type":"string"},"type":"array"},"excludedSagstrinTypes":{"items":{"type":"string"},"type":"array"},"group":{"enum":["laws","questions","financeBills"],"type":"string"},"id":{"type":"string"},"sagsStatuses":{"items":{"type":"string"},"type":"array"},"sagsTypes":{"items":{"type":"string"},"type":"array"},"sagstrinScope":{"enum":["case","document","latest"],"type":"string"},"sagstrinTypes":{"items":{"type":"string"},"type":"array"},"statsbudgetsag":{"type":["boolean","null"]}},"required":["id","group","documentTypes","sagsTypes","sagstrinTypes","sagsStatuses","sagstrinScope","statsbudgetsag","dokumentKategorier","excludedSagstrinTypes"],"type":"object"},"type":"array"}},"required":["presets"],"type":"object"}}},"description":"Nine presets in three groups."}},"summary":"The curated filters, in their groups"}},"/api/profile":{"get":{"description":"Needs a session. The profile, or null.","operationId":"getProfile","responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Profile"},{"type":"null"}]}}},"description":"The profile, or null."}},"summary":"The subscriber's profile (Phase 59)"},"put":{"description":"Needs a session; state-change rule. A draft costs a model call, so only an account paid for (403 `subscription_required`), at most ten a day (429 `draft_quota`), and the same text again asks for nothing (200, not 202). `website` is an https address with a domain, read once by the worker.","operationId":"saveProfile","requestBody":{"content":{"application/json":{"schema":{"properties":{"description":{"maxLength":2000,"type":"string"},"website":{"maxLength":500,"type":"string"}},"required":["description"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}},"description":"Saved; a draft is on its way."}},"summary":"Save the profile and queue a draft (Phase 59)"}},"/api/profile/accept":{"post":{"description":"Needs a session; state-change rule. Only accepted text is ever used. 409 `no_draft` when there is none.","operationId":"acceptProfile","requestBody":{"content":{"application/json":{"schema":{"properties":{"text":{"maxLength":4000,"type":"string"}},"required":["text"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}},"description":"The profile."}},"summary":"Accept the draft, edited or not (Phase 59)"}},"/api/sag-statuses":{"get":{"description":"Values for the `sagsStatuses` search filter. Grouped on the normalised label, because the vocabulary duplicates labels across ids: \"Vedtaget\", \"Forkastet\" and \"Anmeldt\" are three ids each. `ids` lists the members so the grouping can be checked, and `caseCount` sums across them.","operationId":"listSagStatuses","responses":{"200":{"content":{"application/json":{"schema":{"items":{"properties":{"caseCount":{"type":"integer"},"ids":{"items":{"type":"integer"},"type":"array"},"status":{"type":"string"}},"type":"object"},"type":"array"}}},"description":"Outcomes, most common first."}},"summary":"Case outcomes, grouped by normalised label"}},"/api/sag-types":{"get":{"description":"Values for the `sagsTypes` search filter. Effectively static; cached for an hour.","operationId":"listSagTypes","responses":{"200":{"content":{"application/json":{"schema":{"items":{"properties":{"caseCount":{"type":"integer"},"type":{"type":"string"}},"type":"object"},"type":"array"}}},"description":"Case types, most common first."}},"summary":"Case types, with case counts"}},"/api/sagstrin-types":{"get":{"description":"Values for the `sagstrinTypes` search filter, grouped on the normalised label (7 ids share \"Udvalgsbehandling\").\n\n**Pass `sagsType`.** The step vocabulary is meaningless across case types: a § 20-spørgsmål has no \"3. behandling\". Without the parameter you get the global list.","operationId":"listSagstrinTypes","parameters":[{"description":"Narrow to the steps that occur for this case type.","in":"query","name":"sagsType","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"properties":{"ids":{"items":{"type":"integer"},"type":"array"},"label":{"type":"string"},"stepCount":{"type":"integer"}},"type":"object"},"type":"array"}}},"description":"Step labels, most common first."}},"summary":"Case-step labels, optionally scoped to a case type"}},"/api/search":{"post":{"description":"Primary endpoint. `mode` selects the strategy:\n- `semantic` — cosine-similarity ranking over document embeddings (the compute-heavy one; see the latency note on the API description).\n- `exact` — substring/keyword matching.\n- `browse` — filter-only, no query ranking.\n\nAll filter fields are optional and combine with AND. The response's `queryHash` is the handle for `POST /api/search/page` to page through the full ranked set (the `results` array itself is only the first page). When `totalApproximate` is `true`, `totalCount` is a top-K estimate.\n\nIn `semantic` mode results are **ranked, not cut**: without a `threshold` you get the top `limit` documents by score, weak tail included, and `totalCount` is the size of that ranked set, not a count of matching documents. Send `threshold` only to cut at a cosine similarity.","operationId":"search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}},"description":"Search results (first page) + aggregates."},"400":{"description":"Invalid request (e.g. empty query for semantic mode)."}},"summary":"Run a search (semantic / exact / browse)"}},"/api/search/page":{"post":{"description":"Fetches a slice of the ranked result set produced by an earlier `POST /api/search`, identified by its `queryHash`. Fast (no re-ranking). Returns **404** if the cached result has expired or been purged — re-run `POST /api/search` to get a fresh `queryHash`.","operationId":"searchPage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageResponse"}}},"description":"The requested page of results."},"404":{"description":"Cached result expired; re-run the search."}},"summary":"Page through a previous search's ranked results"}},"/api/search/stats":{"post":{"description":"Distributions over every document an earlier `POST /api/search` matched, not just the loaded page, identified by its `queryHash`: by year, document type, policy area, case type and status, actor, and curated filter. Past 20,000 documents the counts cover the first 20,000 and `approximate` is true. Returns **404** for an unknown or expired `queryHash`.","operationId":"searchStats","requestBody":{"content":{"application/json":{"schema":{"properties":{"queryHash":{"type":"string"}},"required":["queryHash"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"approximate":{"type":"boolean"},"byActor":{"description":"The top 50 actor families, most documents first, each with its `members` (a ministry and its minister); send `name` back in `actorNames`.","items":{"properties":{"count":{"type":"integer"},"members":{"items":{"properties":{"name":{"type":"string"},"type":{"type":["string","null"]}},"type":"object"},"type":"array"},"name":{"type":"string"},"type":{"type":["string","null"]}},"type":"object"},"type":"array"},"byCapMajor":{"additionalProperties":{"type":"integer"},"description":"Each document once, under its first policy area.","type":"object"},"byCapMinor":{"additionalProperties":{"type":"integer"},"type":"object"},"byCaseStatus":{"additionalProperties":{"type":"integer"},"type":"object"},"byCaseType":{"additionalProperties":{"type":"integer"},"type":"object"},"byDocumentType":{"additionalProperties":{"type":"integer"},"type":"object"},"byPreset":{"additionalProperties":{"type":"integer"},"description":"Per curated filter id (GET /api/presets), how many of the documents it holds: what that preset added as a filter returns. Every preset is present, zeros included; they overlap, so the counts don't sum to `total`.","type":"object"},"byYear":{"items":{"type":"object"},"type":"array"},"total":{"description":"Documents the counts cover.","type":"integer"}},"required":["total","approximate","byYear","byDocumentType","byCapMajor","byCapMinor","byCaseType","byCaseStatus","byActor","byPreset"],"type":"object"}}},"description":"The distributions."},"404":{"description":"Unknown or expired queryHash; re-run the search."}},"summary":"Counts over a search's whole matched set"}},"/api/search/topic-years":{"post":{"description":"For the semantic search behind `queryHash`: the same request searched wider (up to 20,000 documents) and cut at 75 % of its best score, counted per year. This is the topic's weight over time; the ranked top N of the search itself says little about years. Relative, because a short query scores low everywhere and a fixed cutoff empties it. The wider search is cached like any search. Divide by `GET /api/stats/policy-areas-by-year`'s `documents` for shares. 404 for an unknown or expired hash, 400 for a search that is not semantic. Search rate-limit class, cost 5.","operationId":"topicYears","requestBody":{"content":{"application/json":{"schema":{"properties":{"queryHash":{"type":"string"}},"required":["queryHash"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"best":{"type":"number"},"byYear":{"items":{"properties":{"bucket":{"type":"string"},"count":{"type":"integer"}},"type":"object"},"type":"array"},"capped":{"description":"The wider search hit `limit`: every count is a floor.","type":"boolean"},"cutoff":{"type":"number"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["cutoff","best","total","limit","capped","byYear"],"type":"object"}}},"description":"The topic's documents per year."},"400":{"description":"Not a semantic search with a query."},"404":{"description":"Unknown or expired queryHash."}},"summary":"A semantic search's topic, per year"}},"/api/stats/corpus":{"get":{"description":"`documents` counts `fil_summary`, which IS the searchable set: a row exists once a file has been embedded. Use it instead of hardcoding a corpus size, which goes stale every night.\n\n`updatedAt` is when the nightly sync last finished: the newest `sync_run` that isn't `failed` (a failed night stored nothing; a quiet one checked). `null` until a run has. Cached for five minutes in process; `Cache-Control: max-age` is what is left of them, so the date lags the nightly run by five minutes at most.","operationId":"getCorpus","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"documents":{"type":"integer"},"updatedAt":{"description":"When the nightly sync last finished, or null.","format":"date-time","type":["string","null"]}},"required":["documents","updatedAt"],"type":"object"}}},"description":"The corpus size and its freshness."}},"summary":"How many documents are searchable, and when the data was updated"}},"/api/stats/new-today":{"get":{"description":"Counts distinct documents whose text was indexed today, measured from midnight Europe/Copenhagen.\n\nThis is **our** ingestion time, not Folketinget's `opdateringsdato`. Theirs cannot answer the question: the nightly sync runs at 01:00, so our freshest upstream timestamp is always from the previous day and a count on it is structurally always zero.\n\n`0` is a valid answer on a quiet night. A `0` that persists all day means the 01:00 sync did not run.","operationId":"getNewToday","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"count":{"type":"integer"},"since":{"description":"Midnight Europe/Copenhagen, as an instant.","format":"date-time","type":"string"}},"required":["count","since"],"type":"object"}}},"description":"Today's count."}},"summary":"How many documents became searchable today"}},"/api/stats/policy-areas-by-year":{"get":{"description":"How the Folketing's policy-area mix moves year by year across the whole corpus, computed at startup and nightly at 03:00 Europe/Copenhagen, so no request pays for it. A document counts once, under its FIRST policy area (rank 1), so a year's `byMajor` sums to its `documents` and `share = byMajor[m] / documents` sums to 1 per year. `complete: false` marks the running year. Every year and every major is returned (zeros included); coverage is thin before 2013. Answers 503 with `Retry-After` until the first computation lands. `?format=csv` returns the long-format dataset as an attachment: `year,major_code,major_title,documents,year_documents,share,year_complete`.","operationId":"getPolicyAreasByYear","parameters":[{"in":"query","name":"format","required":false,"schema":{"enum":["json","csv"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"computedAt":{"format":"date-time","type":"string"},"majors":{"items":{"properties":{"code":{"type":"string"},"title":{"type":"string"}},"required":["code","title"],"type":"object"},"type":"array"},"years":{"items":{"properties":{"byMajor":{"additionalProperties":{"type":"integer"},"type":"object"},"complete":{"type":"boolean"},"documents":{"description":"The year's classified documents: the denominator of a share.","type":"integer"},"year":{"type":"integer"}},"required":["year","documents","complete","byMajor"],"type":"object"},"type":"array"}},"required":["computedAt","majors","years"],"type":"object"}},"text/csv":{"schema":{"type":"string"}}},"description":"The statistic (JSON, or CSV with format=csv)."},"400":{"description":"An unknown `format`."},"503":{"description":"Still computing after a boot; see `Retry-After`."}},"summary":"The corpus-wide policy-area mix per year (a stored statistic)"}},"/api/stripe/webhook":{"post":{"description":"For Stripe alone: the `Stripe-Signature` header proves it, and a bad one is a 400. A replay and a kind Archivum doesn't follow are a 200.","operationId":"stripeWebhook","responses":{"200":{"description":"Received."}},"summary":"Stripe's events (Phase 58)"}},"/api/themes":{"get":{"description":"Needs a session. Oldest first, at most five.","operationId":"listThemes","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Theme"},"type":"array"}}},"description":"The themes."}},"summary":"The account's themes (Phase 57)"},"post":{"description":"Needs a session. Must be `application/json` from Archivum's own origin. The description is what is matched against new documents, so it is at least 100 characters after trimming (400 `theme_too_short`) and at most 2,000: one word matched nothing in the digest spike, the same theme as a sentence did. `filters` takes a search's request as it is, so saving a search as a theme sends that; what isn't a filter (the query, the mode, the ranking) is dropped, and so are date bounds, since a theme looks forward. 409 `theme_limit` at five themes.","operationId":"createTheme","requestBody":{"content":{"application/json":{"schema":{"properties":{"alerts":{"default":true,"type":"boolean"},"description":{"maxLength":2000,"minLength":100,"type":"string"},"filters":{"type":"object"},"name":{"maxLength":200,"type":"string"}},"required":["name","description"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Theme"}}},"description":"Saved."}},"summary":"Save a theme (Phase 57)"}},"/api/themes/alerts-off":{"post":{"description":"No session: the mail's link carries the token, and it does this one thing. Must be `application/json` from Archivum's own origin, so a mail scanner opening the link turns nothing off. Every theme of the account stops mailing. 404 for an unknown token.","operationId":"turnThemeAlertsOff","requestBody":{"content":{"application/json":{"schema":{"properties":{"token":{"format":"uuid","type":"string"}},"required":["token"],"type":"object"}}},"required":true},"responses":{"204":{"description":"The alerts are off."}},"summary":"The \"slå fra\" link in a theme mail (Phase 57b)"}},"/api/themes/{id}":{"delete":{"description":"Needs a session; state-change rule as for `POST`. Another account's theme is a 404.","operationId":"deleteTheme","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Deleted."}},"summary":"Delete a theme (Phase 57)"},"patch":{"description":"Needs a session; state-change rule as for `POST`. What is sent changes, and the same limits hold. Another account's theme is a 404.","operationId":"changeTheme","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"alerts":{"type":"boolean"},"description":{"maxLength":2000,"minLength":100,"type":"string"},"filters":{"type":"object"},"name":{"maxLength":200,"type":"string"},"summaries":{"description":"true: this becomes the account's free theme with summaries (Phase 68). Only true; a theme with its mails off is a 400.","type":"boolean"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Theme"}}},"description":"The theme as it is now."}},"summary":"Change a theme (Phase 57)"}}},"servers":[{"description":"Production","url":"https://api.archivum.arostech.dk"}]}