{"record":{"id":"a3845b6181fe0bd2","repo":"SigNoz/signoz","slug":"invalid-input","errorCode":"invalid_input","errorMessage":"keyId is required","messagePattern":"keyId is required","errorType":"http","errorClass":null,"httpStatus":400,"severity":"warning","filePath":"pkg/gateway/handler.go","lineNumber":173,"sourceCode":"\t}\n\n\trender.Success(rw, http.StatusNoContent, nil)\n}\n\nfunc (handler *handler) DeleteIngestionKey(rw http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\n\tclaims, err := authtypes.ClaimsFromContext(ctx)\n\tif err != nil {\n\t\trender.Error(rw, err)\n\t\treturn\n\t}\n\n\torgID := valuer.MustNewUUID(claims.OrgID)\n\n\tkeyID := mux.Vars(r)[\"keyId\"]\n\tif keyID == \"\" {\n\t\trender.Error(rw, errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"keyId is required\"))\n\t\treturn\n\t}\n\n\terr = handler.gateway.DeleteIngestionKey(ctx, orgID, keyID)\n\tif err != nil {\n\t\trender.Error(rw, err)\n\t\treturn\n\t}\n\n\trender.Success(rw, http.StatusNoContent, nil)\n}\n\nfunc (handler *handler) CreateIngestionKeyLimit(rw http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\n\tclaims, err := authtypes.ClaimsFromContext(ctx)\n\tif err != nil {\n\t\trender.Error(rw, err)","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/gateway/handler.go#L155-L191","documentation":"Returned by DeleteIngestionKey when the keyId path variable is empty in the delete request. The handler cannot identify which ingestion key to delete, so it rejects with invalid_input before calling the gateway.","triggerScenarios":"DELETE on a route where mux.Vars(r)[\"keyId\"] resolves to \"\" — trailing-slash URL, misregistered route without {keyId}, or client sending DELETE to the collection endpoint.","commonSituations":"Delete button wired with a null key id producing /ingestion-keys/; router registered as /ingestion-keys for DELETE; proxy normalizing away the path segment.","solutions":["Send DELETE /api/v1/ingestion-keys/{keyId} with a real id","Register the delete route with the {keyId} parameter","Disable/hide the delete action client-side until a key is selected"],"exampleFix":"// before\nDELETE /api/v1/ingestion-keys/\n\n// after\nDELETE /api/v1/ingestion-keys/7f9c24e0-...","handlingStrategy":"validation","validationCode":"keyID := mux.Vars(r)[\"keyId\"]\nif _, err := valuer.NewUUID(keyID); err != nil {\n    http.Error(rw, \"valid keyId required\", http.StatusBadRequest)\n    return\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Guard the delete action on a non-empty selected key id","Register DELETE route with the {keyId} segment and test the 400 path"],"tags":["http","routing","path-params","validation","go"],"backgroundTag":"missing-path-parameter","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}