SigNoz/signoz · warning · model.ApiError

license key is required

Error message

license key is required

What it means

The /billing endpoint (getBilling) requires a licenseKey query parameter and returns BadRequest when it is absent or empty. This is an input-validation error, not a server fault.

Source

Thrown at ee/query-service/app/api/license.go:69

type billingData struct {
	BillingPeriodStart int64   `json:"billingPeriodStart"`
	BillingPeriodEnd   int64   `json:"billingPeriodEnd"`
	Details            details `json:"details"`
	Discount           float64 `json:"discount"`
	SubscriptionStatus string  `json:"subscriptionStatus"`
}

type billingDetails struct {
	Status string      `json:"status"`
	Data   billingData `json:"data"`
}

func (ah *APIHandler) getBilling(w http.ResponseWriter, r *http.Request) {
	licenseKey := r.URL.Query().Get("licenseKey")

	if licenseKey == "" {
		RespondError(w, model.BadRequest(fmt.Errorf("license key is required")), nil)
		return
	}

	claims, err := authtypes.ClaimsFromContext(r.Context())
	if err != nil {
		RespondError(w, model.InternalError(err), nil)
		return
	}

	orgID := valuer.MustNewUUID(claims.OrgID)
	evalCtx := featuretypes.NewFlaggerEvaluationContext(orgID)
	useZeus := ah.Signoz.Flagger.BooleanOrEmpty(r.Context(), flagger.FeatureGetMetersFromZeus, evalCtx)

	if useZeus {
		data, err := ah.Signoz.Zeus.GetMeters(r.Context(), licenseKey)
		if err != nil {
			RespondError(w, model.InternalError(err), nil)
			return

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Include a non-empty licenseKey query parameter in the request
  2. Check the caller/UI code that builds the billing URL
  3. Verify the value is not being dropped by encoding or redirects

Example fix

// before
GET /api/v1/billing
// after
GET /api/v1/billing?licenseKey=<your-license-key>
Defensive patterns

Strategy: validation

Validate before calling

if licenseKey == "" {
    return errors.New("licenseKey query parameter is required")
}

Try / catch

Not applicable — validate the query parameter before making the request.

Prevention

When it happens

Trigger: GET /api/v1/billing (or the EE billing route) without ?licenseKey=... or with an empty value.

Common situations: Frontend not forwarding the license key, manual API calls omitting the param, or URL encoding stripping the value.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/30841b57c2fe8abe. Report an issue: GitHub.