LINE Messaging API · error code

LINE error 400: The maximum number of access tokens has already been issued

ConfigurationHTTP 400401 and channel access token errors

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

What LINE returns
The maximum number of access tokens has already been issued

What error 400 means

Issuing a channel access token v2.1 (POST https://api.line.me/oauth2/v2.1/token) failed because the channel already holds the maximum number of live tokens. The reference states the cap plainly: "You can issue up to 30 tokens per channel for channel access tokens v2.1. If you reach the maximum limit, additional requests of issuing channel access tokens are blocked. An expired channel access token isn't counted as issued."

Your JWT assertion is fine - a bad assertion produces an invalid_client error instead (see invalid_client). What's wrong is the token lifecycle. v2.1 tokens can be valid for up to 30 days, and code that mints a fresh token on every process start, every request, or every deploy accumulates live tokens quickly. Once 30 are outstanding, issuance stops until some expire or you revoke them.

Short-lived channel access tokens also allow 30 per channel but behave differently at the cap: issuing one more revokes the oldest token instead of failing, so the over-issuing bug shows up there as random 401s rather than this 400. LINE's channel access token guide says it directly: don't reissue a token each time you use a channel. The fix is never to wait it out blindly: revoke what you don't need, then change your code so it reuses a token for its lifetime.

What it looks like

// When the maximum number of channel access tokens that can be issued is reached (400 Bad Request)
{
  "message": "The maximum number of access tokens has already been issued"
}

Why it happens

  • Each app instance or serverless invocation issues its own token on startup instead of sharing one.
  • A token refresh job runs far more often than the token lifetime requires.
  • Old tokens from previous deployments were never revoked and are still within their validity period.
  • Several services (bot, CRM sync, analytics) issue tokens for the same channel independently.

How to fix LINE error 400

  1. 1List live token key IDs with GET https://api.line.me/oauth2/v2.1/tokens/kid, which also takes a JWT assertion.
  2. 2Revoke tokens you no longer use with POST https://api.line.me/oauth2/v2.1/revoke.
  3. 3Store the issued token and its expires_in centrally (secret manager or cache) and have every instance read it instead of issuing its own.
  4. 4Issue a new token only when the stored one is close to expiry, then revoke the old one.

How to stop it recurring

Design token handling as a single-writer process: one job issues, stores, and rotates the token, and everything else reads it. Record each token's key_id so you can revoke precisely. Alert when the count of live key IDs passes a threshold well below 30, so a runaway loop is caught before issuance is blocked in production.

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 channel access token v2.1 ( POST https://api.line.me/oauth2/v2.1/token ) failed because the channel already holds the maximum number of live tokens. The reference states the cap plainly: "You can issue up to 30 tokens per channel for channel access tokens v2.1. If you reach the maximum limit, additional requests of issuing channel access tokens are blocked.

How do I fix LINE error 400?

1. List live token key IDs with GET https://api.line.me/oauth2/v2.1/tokens/kid, which also takes a JWT assertion. 2. Revoke tokens you no longer use with POST https://api.line.me/oauth2/v2.1/revoke. 3. Store the issued token and its expires_in centrally (secret manager or cache) and have every instance read it instead of issuing its own. 4. Issue a new token only when the stored one is close to expiry, then revoke the old one.

Stop debugging LINE by hand

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