LINE error 400: The access token expired
Last verified against LINE Developers - Messaging API reference (error responses)
invalid_request / The access token expiredWhat error 400 means
This one comes from LINE's token endpoints rather than the messaging endpoints, and it uses the OAuth-style error shape - error plus error_description - instead of the usual message body. When you verify a channel access token v2.1 with GET /oauth2/v2.1/verify and the token's lifetime has run out, the documented example response is 400 Bad Request with {"error": "invalid_request", "error_description": "The access token expired"}. The same endpoint family returns "The access token not JWS" for an invalidly formatted token, and the verify endpoint's error table adds a third case: "a non-existent channel access token is specified" - i.e. one that was revoked.
Practically, this error is the explicit version of what the messaging endpoints report as 401 Authentication failed: an expired or dead token. The difference is where you catch it. Verifying tokens proactively (or checking expiry from your own issuance records) lets you rotate credentials before message sends start failing. Channel access tokens v2.1 have a lifetime you choose at issuance (up to 30 days), short-lived tokens last 30 days and are capped at 30 issued tokens per channel, and stateless tokens live 15 minutes but can be issued without limit - so every architecture needs a reissue path, not a fix-once mindset.
What it looks like
// If the channel access token has expired (400 Bad Request)
{
"error": "invalid_request",
"error_description": "The access token expired"
}Why it happens
- The channel access token v2.1 passed its expiry chosen at issuance and was never reissued.
- A token was revoked via the revoke endpoint (or superseded during a rotation) but a stale copy is still deployed.
- The value sent isn't a token at all - truncated in a secrets store or wrapped in quotes - yielding "The access token not JWS".
- Clock drift or a scheduling gap in your rotation job let the token lapse before the replacement was issued.
How to fix LINE error 400
- 1Call the matching verify endpoint for your token type and read error_description - expired, malformed, and non-existent each produce distinct strings.
- 2Reissue the token: POST /oauth2/v2.1/token with your JWT assertion (v2.1), or the /v2/oauth/accessToken endpoint for short-lived tokens.
- 3Deploy the new token atomically and confirm a messaging call succeeds before revoking the old one.
- 4Audit your rotation schedule against the lifetime you set at issuance; alert well before expiry, not on failure.
- 5If issuance itself fails, check the 30-token cap for v2.1 and short-lived tokens - revoke unused tokens to free slots (expired ones don't count).
How to stop it recurring
Automate issuance and rotation instead of minting tokens by hand: schedule reissue at a safe fraction of the token lifetime, store tokens in a secrets manager, and run a daily verify call that alerts on anything close to expiry. Stateless tokens (15-minute lifetime, unlimited issuance) remove the storage problem entirely for services that can fetch a token per burst of work. Keep 401 handling as the runtime backstop.
Official reference: LINE Developers - Messaging API reference (error responses). See all LINE error codes or the LINE limits and quotas.
Related codes
- 401: Authentication failedAuthentication failed due to the following reason: XXX <detail varies>
- 400: invalid_client (invalid client_id / client_secret)invalid_client / invalid client_id <detail varies>
- 403: Access to this API is not available for your accountAccess to this API is not available for your account
Error 400 - quick answers
What does LINE error 400 mean?
This one comes from LINE's token endpoints rather than the messaging endpoints, and it uses the OAuth-style error shape - error plus error_description - instead of the usual message body.
How do I fix LINE error 400?
1. Call the matching verify endpoint for your token type and read error_description - expired, malformed, and non-existent each produce distinct strings. 2. Reissue the token: POST /oauth2/v2.1/token with your JWT assertion (v2.1), or the /v2/oauth/accessToken endpoint for short-lived tokens. 3. Deploy the new token atomically and confirm a messaging call succeeds before revoking the old one. 4. Audit your rotation schedule against the lifetime you set at issuance; alert…
Stop debugging LINE by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.