{"record":{"id":"591bfacf5c7a6a9e","repo":"pinpoint-apm/pinpoint","slug":"missing-arguments-webhook-url-and-applicationid-s","errorCode":null,"errorMessage":"Missing arguments: webhook.url and applicationId/serviceName","messagePattern":"Missing arguments: webhook\\.url and applicationId/serviceName","errorType":"validation","errorClass":"ResponseStatusException","httpStatus":400,"severity":"error","filePath":"webhook/src/main/java/com/navercorp/pinpoint/web/webhook/controller/WebhookController.java","lineNumber":49,"sourceCode":"\n    public final static String APPLICATION_ID = \"applicationId\";\n    public final static String SERVICE_NAME = \"serviceName\";\n    public final static String ALARM_RULE_ID = \"ruleId\";\n\n    private final WebhookService webhookService;\n\n\n    public WebhookController(WebhookService webhookService) {\n        this.webhookService = Objects.requireNonNull(webhookService, \"webhookService\");\n    }\n\n    @PostMapping()\n    public WebhookResponse insertWebhook(@RequestBody Webhook webhook) {\n\n        if (!StringUtils.hasText(webhook.getUrl()) || !(StringUtils.hasText(webhook.getApplicationName())\n                || StringUtils.hasText(webhook.getServiceName()))) {\n            logger.info(\"Missing arguments: webhook.url, applicationId/serviceName\");\n            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Missing arguments: webhook.url and applicationId/serviceName\");\n        }\n\n        try {\n            validateURL(webhook);\n        } catch (IllegalArgumentException e) {\n            logger.info(\"Invalid argument: webhook.url\");\n            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Invalid argument: webhook.url\");\n        }\n\n        String webhookId = webhookService.insertWebhook(webhook);\n        return new WebhookResponse(Result.SUCCESS, webhookId);\n    }\n\n    @DeleteMapping()\n    public Response deleteWebhook(@RequestBody Webhook webhook) {\n\n        if (!StringUtils.hasText(webhook.getWebhookId())) {\n            logger.info(\"Missing argument: webhookId\");","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/webhook/src/main/java/com/navercorp/pinpoint/web/webhook/controller/WebhookController.java#L31-L67","documentation":"WebhookController.insertWebhook (POST on the webhook module) requires webhook.url plus at least one of applicationName or serviceName; when url is blank or neither application identifier is present it throws a 400 ResponseStatusException 'Missing arguments: webhook.url and applicationId/serviceName'. No webhook is registered.","triggerScenarios":"POST webhook JSON that omits url, or supplies neither applicationName nor serviceName (or both are empty/whitespace).","commonSituations":"Automation templates that forgot the url field; webhook payloads where the app identifier key was renamed (applicationId vs applicationName); empty strings from form inputs; copy-pasted payloads missing one of the two identifier fields.","solutions":["Add a non-empty webhook.url to the request body","Include either applicationName or serviceName (at least one) in the body","Check for whitespace-only strings — use hasText-validated values, not ' '","Confirm the JSON field names match the Webhook model exactly"],"exampleFix":"// before\nPOST /webhook {\"applicationName\":\"myApp\"}\n// after\nPOST /webhook {\"url\":\"https://hooks.example.com/abc\",\"applicationName\":\"myApp\"}","handlingStrategy":"validation","validationCode":"function validateWebhookPayload(w) {\n  const hasUrl = typeof w.url === 'string' && w.url.trim().length > 0;\n  const hasApp = typeof w.applicationName === 'string' && w.applicationName.trim().length > 0;\n  const hasSvc = typeof w.serviceName === 'string' && w.serviceName.trim().length > 0;\n  if (!hasUrl || !(hasApp || hasSvc)) {\n    throw new Error('webhook requires url and applicationName or serviceName');\n  }\n}","typeGuard":"function isWebhookPayload(w) {\n  return typeof w === 'object' && w !== null &&\n         typeof w.url === 'string' && w.url.length > 0 &&\n         (typeof w.applicationName === 'string' || typeof w.serviceName === 'string');\n}","tryCatchPattern":"try {\n  await axios.post('/webhook', payload);\n} catch (e) {\n  if (e.response && e.response.status === 400 &&\n      String(e.response.data).includes('Missing arguments')) {\n    console.error('Webhook payload missing url or application/service identifier');\n  }\n  throw e;\n}","preventionTips":["Validate url and at least one of applicationName/serviceName before POST","Match field names to the Webhook model exactly (applicationName, not applicationId)","Trim form inputs and reject whitespace-only values","Keep webhook templates in sync with the controller's requirements"],"tags":["http-400","webhook","missing-parameter","rest-api"],"backgroundTag":"missing-required-argument","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}