LINE Messaging API · error code

LINE error 400: Only user id is acceptable (loading animation)

Permanent - do not retryHTTP 400400 / 409 / 413: request body, tokens and payload

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

What LINE returns
Only user id is acceptable, please confirm if there are any group/room ids or illegal ids.

What error 400 means

The loading animation endpoint (POST /v2/bot/chat/loading/start) refused the chatId you sent. The endpoint is defined for one-on-one chats only - it displays "a loading animation in one-on-one chats between users and LINE Official Accounts" - and the error table lists "A group chat or a multi-person chat is specified" and "An invalid user ID is specified" as reasons for a 400. The response is wrapped in the standard validation shape, The request body has 1 error(s), with the detail pinned to the chatId property.

The usual trigger is a bot that copies source from the webhook without checking its type. In a group the source carries a groupId (C...) and in a multi-person chat a roomId (R...); passing either as chatId fails. A userId (U...) from a different provider can also be rejected.

The same endpoint has a sibling validation error in the same shape: loadingSeconds must be one of 5, 10, 15 and so on up to 60, and values outside that set come back with Must be between 5 and 60 or must be a multiple of five. Separately, note that a 202 doesn't mean the animation showed: users who aren't viewing the chat, haven't added you, or have blocked you get no animation and no error.

What it looks like

// If you specify a group chat or a multi-person chat as the destination (400 Bad Request)
{
  "message": "The request body has 1 error(s)",
  "details": [
    {
      "message": "Only user id is acceptable, please confirm if there are any group/room ids or illegal ids.",
      "property": "chatId"
    }
  ]
}

Why it happens

  • The webhook came from a group or multi-person chat, and source.groupId or source.roomId was passed as chatId.
  • The user ID belongs to another provider's channel and isn't valid for this channel.
  • chatId was empty or malformed because the event had no userId (for example a group event where the sender's ID isn't included).

How to fix LINE error 400

  1. 1Branch on source.type: call the loading endpoint only when it is user.
  2. 2Pass source.userId as chatId, never groupId or roomId.
  3. 3Make sure loadingSeconds is a multiple of five between 5 and 60, or omit it to use the default of 20.
  4. 4Wrap the call so a failure here never blocks the actual reply; the animation is cosmetic.

How to stop it recurring

Centralize how you derive the target of any chat-level call from event.source, with an explicit switch on user, group and room. Loading indicators are a good fit for slow AI replies in one-on-one chats, but they don't extend the reply token's life, so the reply still has to go out within its window.

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?

The loading animation endpoint ( POST /v2/bot/chat/loading/start ) refused the chatId you sent. The endpoint is defined for one-on-one chats only - it displays "a loading animation in one-on-one chats between users and LINE Official Accounts" - and the error table lists "A group chat or a multi-person chat is specified" and "An invalid user ID is specified" as reasons for a 400.

How do I fix LINE error 400?

1. Branch on source.type: call the loading endpoint only when it is user. 2. Pass source.userId as chatId, never groupId or roomId. 3. Make sure loadingSeconds is a multiple of five between 5 and 60, or omit it to use the default of 20. 4. Wrap the call so a failure here never blocks the actual reply; the animation is cosmetic.

Should I retry after error 400?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging LINE by hand

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