pinpoint-apm/pinpoint · error · ResponseStatusException

Missing arguments: webhook.url and applicationId/serviceName

Error message

Missing arguments: webhook.url and applicationId/serviceName

What it means

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.

Source

Thrown at webhook/src/main/java/com/navercorp/pinpoint/web/webhook/controller/WebhookController.java:49

    public final static String APPLICATION_ID = "applicationId";
    public final static String SERVICE_NAME = "serviceName";
    public final static String ALARM_RULE_ID = "ruleId";

    private final WebhookService webhookService;


    public WebhookController(WebhookService webhookService) {
        this.webhookService = Objects.requireNonNull(webhookService, "webhookService");
    }

    @PostMapping()
    public WebhookResponse insertWebhook(@RequestBody Webhook webhook) {

        if (!StringUtils.hasText(webhook.getUrl()) || !(StringUtils.hasText(webhook.getApplicationName())
                || StringUtils.hasText(webhook.getServiceName()))) {
            logger.info("Missing arguments: webhook.url, applicationId/serviceName");
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Missing arguments: webhook.url and applicationId/serviceName");
        }

        try {
            validateURL(webhook);
        } catch (IllegalArgumentException e) {
            logger.info("Invalid argument: webhook.url");
            throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid argument: webhook.url");
        }

        String webhookId = webhookService.insertWebhook(webhook);
        return new WebhookResponse(Result.SUCCESS, webhookId);
    }

    @DeleteMapping()
    public Response deleteWebhook(@RequestBody Webhook webhook) {

        if (!StringUtils.hasText(webhook.getWebhookId())) {
            logger.info("Missing argument: webhookId");

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Add a non-empty webhook.url to the request body
  2. Include either applicationName or serviceName (at least one) in the body
  3. Check for whitespace-only strings — use hasText-validated values, not ' '
  4. Confirm the JSON field names match the Webhook model exactly

Example fix

// before
POST /webhook {"applicationName":"myApp"}
// after
POST /webhook {"url":"https://hooks.example.com/abc","applicationName":"myApp"}
Defensive patterns

Strategy: validation

Validate before calling

function validateWebhookPayload(w) {
  const hasUrl = typeof w.url === 'string' && w.url.trim().length > 0;
  const hasApp = typeof w.applicationName === 'string' && w.applicationName.trim().length > 0;
  const hasSvc = typeof w.serviceName === 'string' && w.serviceName.trim().length > 0;
  if (!hasUrl || !(hasApp || hasSvc)) {
    throw new Error('webhook requires url and applicationName or serviceName');
  }
}

Type guard

function isWebhookPayload(w) {
  return typeof w === 'object' && w !== null &&
         typeof w.url === 'string' && w.url.length > 0 &&
         (typeof w.applicationName === 'string' || typeof w.serviceName === 'string');
}

Try / catch

try {
  await axios.post('/webhook', payload);
} catch (e) {
  if (e.response && e.response.status === 400 &&
      String(e.response.data).includes('Missing arguments')) {
    console.error('Webhook payload missing url or application/service identifier');
  }
  throw e;
}

Prevention

When it happens

Trigger: POST webhook JSON that omits url, or supplies neither applicationName nor serviceName (or both are empty/whitespace).

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/591bfacf5c7a6a9e. Report an issue: GitHub.