LINE error 409: The retry key is already accepted
Last verified against LINE Developers - Messaging API reference (error responses)
The retry key is already acceptedWhat error 409 means
You sent a push, multicast, narrowcast, or broadcast request with an X-Line-Retry-Key header, and LINE had already accepted a request carrying that same key. The status table describes 409 as: "An API request with the same retry key has already been accepted." Crucially, this is the idempotency system working, not failing - the 409 is LINE telling you the original send went through, so the duplicate was suppressed and no user got the message twice.
The mechanics: you generate the retry key yourself - "the retry key isn't generated by LINE. Each developer must generate their own retry key" - as a UUID in hexadecimal notation, and attach it to the first attempt. If that attempt times out or errors ambiguously, you retry with the same key; a genuine failure is re-processed, while an already-accepted request returns this 409 along with the x-line-accepted-request-id header carrying the request ID of the accepted original, and - for push - the sentMessages array of the original send. So a 409 handler should treat the operation as succeeded and record the accepted request ID. The retry key exists precisely for ambiguous failures like timeouts and 500 Internal Server Error.
The window is finite: "the retry key management period on the LINE Platform side is 24 hours. If you use the same retry key for more than 24 hours, the request will be treated as a new API request" - and LINE warns explicitly that reusing a key past 24 hours "will succeed as a new API request... As a result, duplicate messages will be sent." Retry keys are for retrying one logical send, not for permanent deduplication.
What it looks like
HTTP/1.1 409 Conflict
x-line-request-id: 123e4567-e89b-12d3-a456-426655440002
x-line-accepted-request-id: 123e4567-e89b-12d3-a456-426655440001
{
"message": "The retry key is already accepted",
"sentMessages": [
{
"id": "461230966842064897",
"quoteToken": "IStG5h1Tz7b..."
}
]
}Why it happens
- A legitimate retry after a timeout - the original request was actually accepted, so the retry correctly returns 409.
- A retry queue or job scheduler replayed the same send (same key) after the first attempt already succeeded.
- The same UUID was reused for two different logical messages within 24 hours - the second is wrongly suppressed as a duplicate.
- Multiple workers picked up the same job and raced; the losers see 409.
- A static or hardcoded retry key instead of a per-send UUID.
How to fix LINE error 409
- 1Treat 409 as success for this logical send: log the x-line-accepted-request-id and mark the job done - do not fall back to sending without the key.
- 2Ensure key generation is one fresh UUID per logical message, stored with the job so every retry of that job reuses it exactly.
- 3If two different messages shared a key, fix the generation bug, then re-send the suppressed message with its own new key.
- 4Bound your retry horizon well under 24 hours - after the management period lapses, retries become duplicate sends.
- 5For crash recovery, persist the key before the first attempt so a restarted worker retries with the same key instead of minting a new one.
How to stop it recurring
Adopt the pattern LINE designed: persist a fresh UUID with every outbound push/multicast/narrowcast/broadcast job before the first network attempt, send it as X-Line-Retry-Key on every attempt, and map 409 to "already delivered". Keep retry windows far inside the 24-hour key lifetime, and audit that no two jobs can share a key. See retry key limits for the documented window and covered endpoints.
Official reference: LINE Developers - Messaging API reference (error responses). See all LINE error codes or the LINE limits and quotas.
Related codes
Error 409 - quick answers
What does LINE error 409 mean?
You sent a push, multicast, narrowcast, or broadcast request with an X-Line-Retry-Key header, and LINE had already accepted a request carrying that same key.
How do I fix LINE error 409?
1. Treat 409 as success for this logical send: log the x-line-accepted-request-id and mark the job done - do not fall back to sending without the key. 2. Ensure key generation is one fresh UUID per logical message, stored with the job so every retry of that job reuses it exactly. 3. If two different messages shared a key, fix the generation bug, then re-send the suppressed message with its own new key. 4. Bound your retry horizon well under 24 hours - after the management…
Should I retry after error 409?
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.