LINE error 400: Invalid audience group id
Last verified against LINE Developers - Messaging API reference (error responses)
Invalid audience group id: {audience ID} <detail varies>What error 400 means
A narrowcast (or audience-management) request referenced an audienceGroupId LINE can't use, and the documented example body echoes the offending value: {"message": "Invalid audience group id: {audience ID}"}. The narrowcast error table explains the two flavors: "an invalid audience is specified, such as a status other than READY," or the ID simply doesn't exist in this channel.
The status detail is the interesting one. Audiences are built asynchronously: after you create one and upload user IDs, the audience passes through processing states before reaching READY, and only a READY audience can be targeted by a narrowcast. Click and impression audiences also need their source data to be old enough to have accumulated, and audiences can end up in failed or expired states. So "the audience exists in the console" is not the same as "the audience is usable right now" - your send pipeline has to check audienceGroupStatus via the get-audience-data endpoint before referencing the ID (size floors then apply separately - see Not enough recipients).
Scoping applies as everywhere on this API: audience IDs belong to the channel (or are shared into it via Business Manager); an ID from another channel or environment is invalid here. And because up to 1,000 audiences can exist per channel, stale IDs from deleted audiences linger in config files long after the audience itself is gone.
What it looks like
// If you specify an invalid audience ID (400 Bad Request)
{
"message": "Invalid audience group id: 1234567890123"
}Why it happens
- The audience isn't READY yet - user-ID uploads or click/impression collection are still processing.
- The audience was deleted, expired, or ended in a failed state, but its ID is still referenced by your campaign config.
- The ID belongs to a different channel or environment (staging audience ID used in production).
- A typo or wrong variable - a requestId or richMenuId pasted where an audienceGroupId belongs.
How to fix LINE error 400
- 1Call GET /v2/bot/audienceGroup/{audienceGroupId} and check audienceGroupStatus - proceed only on READY.
- 2If the audience is mid-processing, poll until READY before sending the narrowcast; job status is visible in the same response.
- 3List audiences with the get-data-for-multiple-audiences endpoint to confirm the ID exists in this channel at all.
- 4Rebuild deleted/expired audiences and update stored IDs; remove dead IDs from campaign configuration.
How to stop it recurring
Gate every narrowcast on a pre-flight audience check (status == READY, expected size present) instead of trusting stored IDs. Keep audience IDs in the same environment-scoped config as channel credentials so cross-environment reuse is impossible, and clean up config when audiences are deleted - the 1,000-audience cap makes periodic pruning necessary anyway. See audience limits.
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?
A narrowcast (or audience-management) request referenced an audienceGroupId LINE can't use, and the documented example body echoes the offending value: {"message": "Invalid audience group id: {audience ID}"} . The narrowcast error table explains the two flavors: "an invalid audience is specified, such as a status other than READY," or the ID simply doesn't exist in this channel.
How do I fix LINE error 400?
1. Call GET /v2/bot/audienceGroup/{audienceGroupId} and check audienceGroupStatus - proceed only on READY. 2. If the audience is mid-processing, poll until READY before sending the narrowcast; job status is visible in the same response. 3. List audiences with the get-data-for-multiple-audiences endpoint to confirm the ID exists in this channel at all. 4. Rebuild deleted/expired audiences and update stored IDs; remove dead IDs from campaign configuration.
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.