LINE error 400: invalid_client (invalid client_id / client_secret)
Last verified against LINE Developers - Messaging API reference (error responses)
invalid_client / invalid client_id <detail varies>What error 400 means
Issuing a short-lived channel access token (POST /v2/oauth/accessToken) failed because the credentials you exchanged are wrong. The endpoint's documented examples are {"error": "invalid_client", "error_description": "invalid client_id"} when the channel ID is invalid and {"error": "invalid_client", "error_description": "invalid client_secret"} when the channel secret is invalid; the error table adds a third possibility, "the request parameters are in the wrong format" - this endpoint takes application/x-www-form-urlencoded parameters, not JSON.
The distinction from The access token expired matters: that error is about a token you already had; this one means you never got a token because the channel ID/secret pair didn't authenticate. The usual root causes are credential mix-ups rather than typos: the channel secret from a different channel (a LINE Login channel instead of the Messaging API channel, or staging instead of production), a secret that was reset in the LINE Developers Console while deployments still carry the old value, or a form body that was accidentally JSON-encoded so the parameters never parsed.
For the v2.1 endpoint (JWT assertion flow), the equivalent failures are documented as the JWT assertion failing verification or having expired, plus a 404 when the signature key isn't registered in the channel - same category, different mechanics.
What it looks like
// If you specify an invalid channel ID (400 Bad Request)
{
"error": "invalid_client",
"error_description": "invalid client_id"
}Why it happens
- The channel secret belongs to a different channel - LINE Login vs Messaging API, or staging vs production.
- The channel secret was reset in the LINE Developers Console and running services still use the old value.
- The channel ID has a typo or was swapped with the channel secret in configuration.
- The request body was sent as JSON instead of application/x-www-form-urlencoded, mangling the parameters.
- For v2.1: the JWT assertion is expired, signed with the wrong key, or the key isn't registered in the channel (404).
How to fix LINE error 400
- 1Read error_description first - client_id and client_secret failures are called out separately, which halves the search space.
- 2Compare the channel ID and secret against the channel's Basic settings tab in the LINE Developers Console, from the exact channel that owns the bot.
- 3Send the request form-encoded: grant_type=client_credentials&client_id=...&client_secret=... with Content-Type: application/x-www-form-urlencoded.
- 4If the secret may have been rotated, issue a fresh one deliberately, update every environment, and redeploy.
- 5After a successful issue, verify the token with the verify endpoint and store the expires_in so rotation can be scheduled.
How to stop it recurring
Keep channel ID and secret as a paired secret in one store entry so they can't drift apart, and label them by channel type and environment - the "wrong channel's secret" failure is almost always a labeling problem. Rotate deliberately with a two-step deploy (issue new, switch, revoke old), and monitor the issuance endpoint's 370-requests-per-second rate limit only if you mint tokens per request, which you shouldn't.
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?
Issuing a short-lived channel access token ( POST /v2/oauth/accessToken ) failed because the credentials you exchanged are wrong.
How do I fix LINE error 400?
1. Read error_description first - client_id and client_secret failures are called out separately, which halves the search space. 2. Compare the channel ID and secret against the channel's Basic settings tab in the LINE Developers Console, from the exact channel that owns the bot. 3. Send the request form-encoded: grant_type=client_credentials&client_id=...&client_secret=... with Content-Type: application/x-www-form-urlencoded. 4. If the secret may have been rotated, issue a…
Stop debugging LINE by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.