{"record":{"id":"826210f33e058f80","repo":"mem0ai/mem0","slug":"bad-request-to-path-detail-826210","errorCode":null,"errorMessage":"Bad request to {path}: {detail}","messagePattern":"Bad request to (.+?): (.+?)","errorType":"http","errorClass":"APIError","httpStatus":400,"severity":"error","filePath":"cli/python/src/mem0_cli/backend/platform.py","lineNumber":52,"sourceCode":"            timeout=30.0,\n        )\n\n    def _request(self, method: str, path: str, **kwargs: Any) -> Any:\n        from mem0_cli.state import capture_notice, is_agent_mode\n\n        self._client.headers[\"X-Mem0-Caller-Type\"] = \"agent\" if is_agent_mode() else \"user\"\n        resp = self._client.request(method, path, **kwargs)\n        if resp.status_code == 401:\n            raise AuthError(\"Authentication failed. Your API key may be invalid or expired.\")\n        if resp.status_code == 404:\n            raise NotFoundError(f\"Resource not found: {path}\")\n        if resp.status_code == 400:\n            # Extract API error detail when available\n            try:\n                detail = resp.json().get(\"detail\", resp.text)\n            except Exception:\n                detail = resp.text\n            raise APIError(f\"Bad request to {path}: {detail}\")\n        resp.raise_for_status()\n        if resp.status_code == 204:\n            return {}\n        data = resp.json()\n\n        # Pull the unclaimed-Agent-Mode notice out of the body (or the header\n        # fallback for endpoints that return non-dict / non-dict-leading\n        # payloads) and stash it for end-of-command surfacing.\n        notice = None\n        if isinstance(data, dict) and \"mem0_notice\" in data:\n            notice = data.pop(\"mem0_notice\")\n        elif (\n            isinstance(data, list)\n            and data\n            and isinstance(data[0], dict)\n            and \"mem0_notice\" in data[0]\n        ):\n            notice = data[0].pop(\"mem0_notice\")","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/cli/python/src/mem0_cli/backend/platform.py#L34-L70","documentation":"Error \"Bad request to {path}: {detail}\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at cli/python/src/mem0_cli/backend/platform.py:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review the request parameters sent to the given path against the API documentation.","Fix the malformed or missing field reported in the detail message and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}