{"record":{"id":"4b24200357c24abd","repo":"langfuse/langfuse","slug":"this-feature-is-not-available-on-your-current-plan","errorCode":null,"errorMessage":"This feature is not available on your current plan.","messagePattern":"This feature is not available on your current plan\\.","errorType":"http","errorClass":null,"httpStatus":403,"severity":"warning","filePath":"web/src/pages/api/admin/organizations/[organizationId]/apiKeys/[apiKeyId].ts","lineNumber":33,"sourceCode":") {\n  try {\n    if (req.method !== \"DELETE\") {\n      res.status(405).json({ error: \"Method Not Allowed\" });\n      return;\n    }\n\n    // Verify admin API authentication, only allow on self-hosted (not on Langfuse Cloud)\n    if (!AdminApiAuthService.handleAdminAuth(req, res)) {\n      return;\n    }\n\n    if (\n      !hasEntitlementBasedOnPlan({\n        plan: getSelfHostedInstancePlanServerSide(),\n        entitlement: \"admin-api\",\n      })\n    ) {\n      return res.status(403).json({\n        error: \"This feature is not available on your current plan.\",\n      });\n    }\n\n    const params = validateQueryParams(req.query);\n    if (!params) {\n      return res.status(400).json({ error: \"Invalid request parameters\" });\n    }\n\n    const { organizationId, apiKeyId } = params;\n\n    // Check if organization exists\n    const organization = await prisma.organization.findUnique({\n      where: { id: organizationId },\n    });\n\n    if (!organization) {\n      return res.status(404).json({ error: \"Organization not found\" });","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/langfuse/langfuse/blob/59d92c7cf365150d10b753b5a0d1708902a2ed60/web/src/pages/api/admin/organizations/[organizationId]/apiKeys/[apiKeyId].ts#L15-L51","documentation":"HTTP 403 plan-gating response: the self-hosted instance's current plan (getSelfHostedInstancePlanServerSide) lacks the 'admin-api' entitlement, so the operation is refused before parameter validation. This is Langfuse's plan-based feature gate on the admin API surface.","triggerScenarios":"Self-hosted instance running on the free/oss plan (no enterprise license or EE features enabled) hitting the organization API key admin endpoint.","commonSituations":"Self-hosting without an enterprise license key; LICENSE_KEY env var missing or invalid after redeploy; expecting OSS build to include admin API features gated to enterprise.","solutions":["Set a valid enterprise license/configuration so the plan resolves to one with the admin-api entitlement","Or stop using admin API endpoints on plans without the entitlement; manage keys via the standard project endpoints","Verify getSelfHostedInstancePlanServerSide resolves the expected plan (check env/license configuration)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const plan = await getInstancePlan();\nif (!hasEntitlement(plan, 'admin-api')) useProjectScopedApiKeysInstead();","typeGuard":"const hasAdminApiEntitlement = (plan: string): boolean => ADMIN_API_PLANS.has(plan);","tryCatchPattern":"try { await adminDelete(); } catch (e) { if (e.status === 403) fallbackToProjectKeyManagement(); else throw e; }","preventionTips":["Confirm license/plan env vars on self-hosted deployments before scripting admin APIs","Design scripts to degrade to non-admin endpoints when entitlement is absent"],"tags":["admin-api","plan-entitlement","http-403","self-hosted"],"backgroundTag":"plan-entitlement-required","analyzedSha":"59d92c7cf365150d10b753b5a0d1708902a2ed60","analyzedAt":"2026-08-27T22:22:00.402Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}