LINE Messaging API · error code

LINE error 400: Invalid webhook endpoint URL

ConfigurationHTTP 400Webhook configuration errors

Last verified against LINE Developers - Messaging API reference (error responses)

What LINE returns
Invalid webhook endpoint URL

What error 400 means

You called PUT /v2/bot/channel/webhook/endpoint to set your channel's webhook URL and LINE rejected the value: the endpoint's error table says "an invalid webhook endpoint URL is specified," and the request-body spec demands "a valid webhook URL". In practice that means a well-formed, publicly reachable HTTPS URL - the LINE Platform delivers webhooks as "an HTTPS POST request to the webhook URL (bot server)", so plain http://, localhost addresses, missing schemes, or strings with stray whitespace don't qualify.

This error is about the URL string you're registering, not about whether your server currently answers. A syntactically valid HTTPS URL that points at a dead server will be accepted here and fail later - which you can see with the separate test-webhook-endpoint API, and which surfaces at runtime as missed events. If your bot is silent even though this call succeeded, the problem has moved from configuration to delivery: check signature verification, your 200 responses, and consider webhook redelivery, or walk through a systematic debugging pass like our webhook debugging guide.

Note the endpoint's rate limit is generous (1,000 requests per minute for the webhook settings pair), so hitting limits here is rare; virtually every failure is the URL itself.

What it looks like

// If you specify an invalid webhook endpoint URL (400 Bad Request)
{
  "message": "Invalid webhook endpoint URL"
}

Why it happens

  • The URL uses http:// instead of https:// - webhooks are delivered only over HTTPS.
  • A placeholder, empty string, or URL with whitespace/newline characters was sent from a misconfigured environment variable.
  • The URL points at localhost, a private IP, or an internal hostname the LINE Platform can't resolve.
  • The value isn't a URL at all - a path fragment like /webhook without scheme and host.
  • Copy-paste artifacts such as trailing quotes or angle brackets around the URL.

How to fix LINE error 400

  1. 1Print the exact endpoint value your code sends - especially if it comes from an environment variable that may be empty in this environment.
  2. 2Ensure the scheme is https:// and the host is a public DNS name with a valid TLS certificate.
  3. 3Re-set the URL, then call GET /v2/bot/channel/webhook/endpoint to confirm what LINE stored and whether active is true.
  4. 4Use the test webhook endpoint API (or the Verify button in the LINE Developers Console) to confirm LINE can reach your server.
  5. 5For local development, expose your server through an HTTPS tunnel and register the tunnel URL instead of localhost.

How to stop it recurring

Treat the webhook URL as deploy-time configuration with validation: assert it parses as HTTPS with a public host before calling the settings endpoint. After every environment change, run the verification pair - set, get, test - and alert if active is false. Keep signature verification and fast 200 responses in place so the registered URL keeps working once accepted; see webhook rules for the delivery contract.

Official reference: LINE Developers - Messaging API reference (error responses). See all LINE error codes or the LINE limits and quotas.

Related codes

Error 400 - quick answers

What does LINE error 400 mean?

You called PUT /v2/bot/channel/webhook/endpoint to set your channel's webhook URL and LINE rejected the value: the endpoint's error table says "an invalid webhook endpoint URL is specified," and the request-body spec demands "a valid webhook URL" .

How do I fix LINE error 400?

1. Print the exact endpoint value your code sends - especially if it comes from an environment variable that may be empty in this environment. 2. Ensure the scheme is https:// and the host is a public DNS name with a valid TLS certificate. 3. Re-set the URL, then call GET /v2/bot/channel/webhook/endpoint to confirm what LINE stored and whether active is true. 4. Use the test webhook endpoint API (or the Verify button in the LINE Developers Console) to confirm LINE can reach…

Stop debugging LINE by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.