LINE Messaging API · error code

LINE error 400: forbidPartialDelivery must be used with upToRemainingQuota

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
The option forbidPartialDelivery must be used with upToRemainingQuota.

What error 400 means

A narrowcast request (POST /v2/bot/message/narrowcast) carried a limit object with forbidPartialDelivery: true but without upToRemainingQuota: true. The reference documents the example exactly: "If you set limit.forbidPartialDelivery to true without setting limit.upToRemainingQuota to true (400 Bad Request)." The narrowcast error table classifies it as "An invalid combination of request parameters is specified."

The two flags only make sense together. upToRemainingQuota caps the send at the number of messages you can still deliver this month. forbidPartialDelivery then says: if that cap would cut the audience short, send to nobody instead of a random subset. On its own, forbidPartialDelivery has no quota to compare against, so LINE rejects the request. The reference is explicit: "The forbidPartialDelivery property can only be specified if the upToRemainingQuota property is set to true."

Because narrowcast is asynchronous, also remember where a canceled all-or-nothing send shows up: not in this response, but in the progress endpoint, where the phase is failed and the errorCode is 5. The reference also notes that when narrowcast returns an error, no messages are sent to anyone.

What it looks like

// If you set limit.forbidPartialDelivery to true without setting limit.upToRemainingQuota to true (400 Bad Request)
{
  "message": "The option forbidPartialDelivery must be used with upToRemainingQuota."
}

Why it happens

  • The limit object sets forbidPartialDelivery: true and leaves upToRemainingQuota unset, which defaults to false.
  • A config layer drops upToRemainingQuota when it is true but keeps forbidPartialDelivery.
  • Copying a limit object from one campaign and editing only part of it.

How to fix LINE error 400

  1. 1Send both flags together: {"upToRemainingQuota": true, "forbidPartialDelivery": true}, optionally with max.
  2. 2If you don't want quota capping at all, remove forbidPartialDelivery from the limit object.
  3. 3After a successful 202, poll GET /v2/bot/message/progress/narrowcast with the request ID and treat phase failed with errorCode 5 as a canceled all-or-nothing send.
  4. 4Check the remaining quota with the quota endpoints before scheduling large campaigns.

How to stop it recurring

Model the limit object as a small typed struct in your code where forbidPartialDelivery can only be set alongside upToRemainingQuota. Decide per campaign whether partial delivery is acceptable, write it down, and add the progress check to the campaign runner so canceled sends are reported instead of silently missing. See monthly quota for how sends are counted.

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 request ( POST /v2/bot/message/narrowcast ) carried a limit object with forbidPartialDelivery: true but without upToRemainingQuota: true .

How do I fix LINE error 400?

1. Send both flags together: {"upToRemainingQuota": true, "forbidPartialDelivery": true}, optionally with max. 2. If you don't want quota capping at all, remove forbidPartialDelivery from the limit object. 3. After a successful 202, poll GET /v2/bot/message/progress/narrowcast with the request ID and treat phase failed with errorCode 5 as a canceled all-or-nothing send. 4. Check the remaining quota with the quota endpoints before scheduling large campaigns.

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.