Discord API · error code

Discord error 520001: Poll expired

Permanent - do not retryHTTP 400Validation and request shape

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Poll expired

What error 520001 means

The poll you tried to act on has already ended. Polls have a fixed duration, set in hours when they are created (up to 32 days), and once that time passes, or once someone ends it early, Discord treats the poll as expired.

For bots this usually comes from POST /channels/{channel.id}/polls/{message.id}/expire, called to end a poll that already ended on its own or was ended by a moderator. Scheduled "close the poll at the deadline" jobs race against the poll's built-in expiry and can lose.

The poll's results are still available on the message once it has ended. Reading them does not require expiring the poll.

The expiry time is stored on the poll as poll.expiry, so a bot can compare it with the current time before deciding whether an expire call is needed.

What it looks like

{
  "message": "Poll expired",
  "code": 520001
}

Why it happens

  • Poll's duration elapsed before the expire call
  • Another moderator or process ended the poll first
  • Scheduled close job ran after the built-in expiry
  • Expire call retried after the first one succeeded
  • Clock skew between your server and Discord making the poll look open when it is not

How to fix Discord error 520001

  1. 1Fetch the message and check poll.expiry before calling expire
  2. 2Treat 520001 on expire as success
  3. 3Rely on the poll's own duration instead of a separate close job where possible
  4. 4Read final results from the message's poll results once expired
  5. 5Keep your host clock synced so expiry comparisons are accurate

How to stop it recurring

Set the poll's duration to match your deadline and let Discord end it, rather than scheduling your own expire call. If you must end polls early, make the call idempotent. Editing a poll is not allowed at all; see 520003.

Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.

Related codes

Error 520001 - quick answers

What does Discord error 520001 mean?

The poll you tried to act on has already ended. Polls have a fixed duration, set in hours when they are created (up to 32 days), and once that time passes, or once someone ends it early, Discord treats the poll as expired. For bots this usually comes from POST /channels/{channel.id}/polls/{message.id}/expire , called to end a poll that already ended on its own or was ended by a moderator.

How do I fix Discord error 520001?

1. Fetch the message and check poll.expiry before calling expire 2. Treat 520001 on expire as success 3. Rely on the poll's own duration instead of a separate close job where possible 4. Read final results from the message's poll results once expired 5. Keep your host clock synced so expiry comparisons are accurate

Should I retry after error 520001?

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 Discord by hand

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