{"record":{"id":"08a54e1cc0e19470","repo":"languagetool-org/languagetool","slug":"you-re-using-an-old-version-of-our-api-that-s-not","errorCode":null,"errorMessage":"You're using an old version of our API that's not supported anymore. Please see ","messagePattern":"You're using an old version of our API that's not supported anymore\\. Please see ","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java","lineNumber":215,"sourceCode":"                \" per \" + errorRequestLimiter.getRequestLimitPeriodInSeconds() + \" seconds\";\n        int code = 429; // too many requests\n        sendError(httpExchange, code, errorMessage);\n        logError(errorMessage, code, parameters, httpExchange);\n        return;\n      }\n      if (workQueueFull(httpExchange, parameters, \"Error: There are currently too many parallel requests. Please try again later.\")) {\n        ServerMetricsCollector.getInstance().logRequestError(ServerMetricsCollector.RequestErrorType.QUEUE_FULL);\n        return;\n      }\n      if (allowedIps == null || allowedIps.contains(origAddress)) {\n        if (path.startsWith(\"/v2/\")) {\n          ApiV2 apiV2 = new ApiV2(textCheckerV2, config.getAllowOriginUrl());\n          String pathWithoutVersion = path.substring(\"/v2/\".length());\n          final Map<String, String> finalParameters = parameters;\n          final String finalRemoteAddress = remoteAddress;\n          TelemetryProvider.INSTANCE.createSpan(\"/v2\", Attributes.empty(), () -> apiV2.handleRequest(pathWithoutVersion, httpExchange, finalParameters, errorRequestLimiter, finalRemoteAddress, config));\n        } else if (path.endsWith(\"/Languages\")) {\n          throw new BadRequestException(\"You're using an old version of our API that's not supported anymore. Please see \" + API_DOC_URL);\n        } else if (path.equals(\"/\")) {\n          throw new BadRequestException(\"Missing arguments for LanguageTool API. Please see \" + API_DOC_URL);\n        } else if (path.contains(\"/v2/\")) {\n          throw new BadRequestException(\"You have '/v2/' in your path, but not at the root. Try an URL like 'http://server/v2/...' \");\n        } else if (path.equals(\"/favicon.ico\")) {\n          sendError(httpExchange, HttpURLConnection.HTTP_NOT_FOUND, \"Not found\");\n        } else {\n          throw new BadRequestException(\"This is the LanguageTool API. You have not specified any parameters. Please see \" + API_DOC_URL);\n        }\n      } else {\n        String errorMessage = \"Error: Access from \" + StringTools.escapeXML(origAddress) + \" denied\";\n        sendError(httpExchange, HttpURLConnection.HTTP_FORBIDDEN, errorMessage);\n        throw new RuntimeException(errorMessage);\n      }\n    } catch (Exception e) {\n      String response;\n      int errorCode;\n      boolean textLoggingAllowed = false;","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java#L197-L233","documentation":"The LanguageTool HTTP handler rejects legacy API endpoints with a BadRequestException. Requests ending in '/Languages' (the old v1 way to list languages) are no longer supported; clients must use the versioned /v2 API instead.","triggerScenarios":"An HTTP request whose path ends with `/Languages` reaches handle() — i.e. a client calling the deprecated v1 `GET /Languages` endpoint on the server root.","commonSituations":"Old client code or scripts written for LanguageTool API v1 still listing languages via `/Languages`, tutorials/bookmarks predating the v2 API, or libraries that never migrated to `/v2/languages`.","solutions":["Change the client to call `GET /v2/languages` (lowercase) to list supported languages","Upgrade any LanguageTool client library to a version that targets the v2 API","Follow the API documentation URL included in the error message to map old endpoints to v2 equivalents"],"exampleFix":"// before\ncurl http://server:8081/Languages\n// after\ncurl http://server:8081/v2/languages","handlingStrategy":"try-catch","validationCode":"// client-side: ensure v2 endpoint\nif (!apiUrl.endsWith(\"/v2/languages\")) {\n  apiUrl = apiUrl.replaceFirst(\"/(Languages)$\", \"/v2/languages\");\n}","typeGuard":null,"tryCatchPattern":"HttpResponse<String> resp = client.send(req, BodyHandlers.ofString());\nif (resp.statusCode() == 400 && resp.body().contains(\"not supported anymore\")) {\n  throw new IllegalStateException(\"Legacy API endpoint used; migrate to /v2\");\n}","preventionTips":["Use only /v2/ endpoints (e.g. /v2/languages, /v2/check)","Upgrade LanguageTool client libraries to v2-compatible versions","Search code/scripts for literal 'Languages' URLs during API migrations"],"tags":["http","api","deprecated"],"backgroundTag":"deprecated-api-usage","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}