{"record":{"id":"64dad1ad3dcb731b","repo":"vxcontrol/pentagi","slug":"the-endpoint-requested-is-hidden-for-administrator-64dad1","errorCode":null,"errorMessage":"the endpoint requested is hidden for administrators only","messagePattern":"the endpoint requested is hidden for administrators only","errorType":"http","errorClass":"Fatal","httpStatus":403,"severity":"error","filePath":"backend/pkg/tools/searchers/tavily.go","lineNumber":154,"sourceCode":"\tdefer resp.Body.Close()\n\n\treturn t.parseHTTPResponse(ctx, resp)\n}\n\nfunc (t *tavily) parseHTTPResponse(ctx context.Context, resp *http.Response) (string, error) {\n\tswitch resp.StatusCode {\n\tcase http.StatusOK:\n\t\tvar respBody tavilySearchResult\n\t\tif err := json.NewDecoder(resp.Body).Decode(&respBody); err != nil {\n\t\t\treturn \"\", Fatal(fmt.Errorf(\"failed to decode response body: %v\", err))\n\t\t}\n\t\treturn t.buildTavilyResult(ctx, &respBody), nil\n\tcase http.StatusBadRequest:\n\t\treturn \"\", Fatal(fmt.Errorf(\"request is invalid\"))\n\tcase http.StatusUnauthorized:\n\t\treturn \"\", Fatal(fmt.Errorf(\"API key is wrong\"))\n\tcase http.StatusForbidden:\n\t\treturn \"\", Fatal(fmt.Errorf(\"the endpoint requested is hidden for administrators only\"))\n\tcase http.StatusNotFound:\n\t\treturn \"\", Fatal(fmt.Errorf(\"the specified endpoint could not be found\"))\n\tcase http.StatusMethodNotAllowed:\n\t\treturn \"\", Fatal(fmt.Errorf(\"there need to try to access an endpoint with an invalid method\"))\n\tcase http.StatusTooManyRequests:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there are requesting too many results\"), 0)\n\tcase http.StatusInternalServerError:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there had a problem with our server. try again later\"), 0)\n\tcase http.StatusBadGateway:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there was a problem with the server. Please try again later\"), 0)\n\tcase http.StatusServiceUnavailable:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there are temporarily offline for maintenance. please try again later\"), 0)\n\tcase http.StatusGatewayTimeout:\n\t\treturn \"\", Retryable(fmt.Errorf(\"there are temporarily offline for maintenance. please try again later\"), 0)\n\tdefault:\n\t\treturn \"\", Fatal(fmt.Errorf(\"unexpected status code: %d\", resp.StatusCode))\n\t}\n}","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/searchers/tavily.go#L136-L172","documentation":"Thrown in tavily.parseHTTPResponse when Tavily answers HTTP 403 Forbidden, mapped to the message \"the endpoint requested is hidden for administrators only\". It means the credentials are valid but the account is not allowed to use this endpoint/feature — a plan or permission problem, not a malformed request. Classified Fatal: retrying with the same account cannot succeed.","triggerScenarios":"POST to api.tavily.com/search returns 403: the account's plan does not include the requested feature (e.g. advanced search depth, raw_content, include_answer), the account is suspended, or the key lacks required scope.","commonSituations":"Free-tier account hitting features that require a paid plan; account temporarily banned for abuse; org switched plans and the old key lost entitlements; regional/IP-based blocking by Tavily presenting as 403.","solutions":["Log in to the Tavily dashboard and verify the account's plan and standing — upgrade if the requested features (search_depth=advanced, raw_content) require a paid tier.","Read the 403 response body from Tavily (it names the denied feature) instead of relying on the static string.","Reduce the request to plan-supported options (drop IncludeRawContent/IncludeAnswer or set SearchDepth to \"basic\") and retest.","If the account was suspended, contact Tavily support to restore access.","If the feature is not needed, keep the current plan and disable the premium options in tavilyRequest."],"exampleFix":"// before: premium features on a free plan -> 403\nreqPayload := tavilyRequest{ ..., SearchDepth: \"advanced\", IncludeRawContent: true, IncludeAnswer: true }\n// after: plan-safe defaults\nreqPayload := tavilyRequest{ ..., SearchDepth: \"basic\", IncludeRawContent: false, IncludeAnswer: false }","handlingStrategy":"fallback","validationCode":"// check plan entitlements before enabling premium request options\nif planTiers[cfg.TavilyPlan] < planRequired(\"advanced\") {\n    useBasicDepthOnly = true\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"hidden for administrators only\") {\n        // permanent for this account: switch permanently to a fallback engine\n        return fallbackSearcher.Handle(ctx, req)\n    }\n    return err\n}","preventionTips":["Match request options (search_depth=advanced, raw_content, include_answer) to the account's actual plan.","Verify account standing in the Tavily dashboard after any billing/plan change.","Read the 403 body once to learn which feature is denied, then disable it in code.","Keep a non-Tavily fallback engine configured so plan restrictions degrade gracefully."],"tags":["authorization","http-403","searchers","plan-limits","go"],"backgroundTag":"http-403-forbidden","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}