Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs: describe v2 API migration changes (#7315)

LearningCircuit2319b0e6a36d
diff --git a/changelog.d/3299.breaking.md b/changelog.d/3299.breaking.md
index 51c0a1a3ef..4f17ab0507 100644
--- a/changelog.d/3299.breaking.md
+++ b/changelog.d/3299.breaking.md
@@ -25,8 +25,30 @@ custom API clients should prepare for these compatibility changes:
Fix the data-directory permissions or key-file contents before upgrading.
- **Session cookies now use `SameSite=Strict`** instead of `Lax`. Cross-site
embeds and integrations that depend on cross-site cookie delivery must adjust.
-- **Session-authenticated `POST /api/v1/*` clients must send a CSRF token**,
- available from `GET /auth/csrf-token`. A missing or invalid token returns 403.
+- **Session-authenticated `POST /api/v1/quick_summary`, `/generate_report` and
+ `/analyze_documents` clients must now send a CSRF token.** v1.x exempted these
+ endpoints, so tokenless calls worked; fetch the token from
+ `GET /auth/csrf-token` after signing in. A missing or invalid token returns
+ 403.
+- **CSRF failures on all other endpoints now return 403 instead of 400**,
+ including `POST /api/v1/research/{id}/export/{format}`. Those endpoints
+ already required a token in v1.x.
+- **The CSRF token must be sent in a header for multipart requests.** v1.x
+ read the token from any form field, including multipart parts. A
+ `csrf_token` form field is now honored only in
+ `application/x-www-form-urlencoded` bodies of 256 KB or less; otherwise only
+ the `X-CSRFToken` or `X-CSRF-Token` header counts, and a multipart request
+ without it returns 403.
+- **Date fields are ISO 8601** rather than RFC-822 HTTP dates:
+ `timestamp` in `GET /api/research/{id}/logs`, `time` in the log entries of
+ `GET /history/logs/{id}` and `GET /history/details/{id}`, and
+ `published_date` in `GET /library/api/documents` (now `YYYY-MM-DD`). Update
+ clients that parse these fields.
+- **Malformed numeric API path parameters now return 422 rather than 404.**
+ Clients that classify missing resources by status should treat 422 as a
+ validation error, for example on numeric benchmark-run or resource IDs.
+- **`GET /settings` now redirects with 307 to `/settings/`.** Custom clients
+ that do not follow redirects should request the trailing-slash path.
- **Rate-limit storage now prefers `RATE_LIMIT_STORAGE_URI`.** The former
`RATELIMIT_STORAGE_URL` name remains supported as a fallback, so existing
deployments do not need an immediate configuration change.
diff --git a/docs/deployment/upgrading.md b/docs/deployment/upgrading.md
index a4195f2d5b..72768caaef 100644
--- a/docs/deployment/upgrading.md
+++ b/docs/deployment/upgrading.md
@@ -78,6 +78,33 @@ Review the release notes for custom API-client changes, including the removed
legacy news routes and CSRF requirements. See the
[configuration reference](../CONFIGURATION.md) for current settings.
+CSRF changes for session-cookie clients making state-changing requests
+(POST, PUT, PATCH or DELETE): v1.x exempted the programmatic `/api/v1`
+endpoints (`POST /api/v1/quick_summary`, `/api/v1/generate_report` and
+`/api/v1/analyze_documents`) from CSRF checks, so those calls worked with no
+token. They are now enforced: keep the same cookie jar, sign in, then fetch
+`GET /auth/csrf-token` and send the returned token in `X-CSRFToken`. A token
+fetched before sign-in is invalid because sign-in resets the session. An absent
+or invalid token now returns 403. On every other endpoint, including
+`POST /api/v1/research/{id}/export/{format}`, v1.x already required a token and
+answered a failure with 400; that status is now 403.
+
+The token transport also narrowed. v1.x (Flask-WTF) read the token from any
+form field, including multipart fields. Now a `csrf_token` form field is read
+only from `application/x-www-form-urlencoded` bodies of 256 KB or less;
+otherwise only the `X-CSRFToken` or `X-CSRF-Token` header counts. Multipart
+clients, such as file uploads that carried `csrf_token` as a form part, must
+send the header or they now receive 403.
+
+For clients parsing web responses, these date fields now emit ISO 8601 instead
+of RFC-822 HTTP dates: `timestamp` in `GET /api/research/{id}/logs`, `time` in
+each log entry of `GET /history/logs/{id}` and `GET /history/details/{id}`
+(`log` list, database-stored entries), and `published_date` in
+`GET /library/api/documents` (now `YYYY-MM-DD`). Malformed numeric
+path parameters now return 422 instead of 404. `GET /settings` without a
+trailing slash now returns a 307 redirect to `/settings/`; request the latter
+directly if the client does not follow redirects.
+
### PDFs in the old shared library directory
Library reads no longer fall back from a missing per-user PDF to the old