Discord error 40002: Account verification required
Last verified against Discord Developer Docs - Opcodes and status codes
You need to verify your account in order to perform this actionWhat error 40002 means
The acting account has not completed Discord's account verification (typically email verification, sometimes phone verification depending on the server's verification level) and the server or Discord itself requires it for the action. For bots this surfaces in two ways.
First, when acting on behalf of a user through OAuth2 (for example guilds.join), the user's own account must be verified to the level the target guild demands; an unverified user cannot be added to a server with a verification level above None. Second, and more surprisingly, the bot's owner account must be verified. A bot created under a brand-new developer account with an unverified email can be refused certain actions, and in rare cases cannot be invited, until the owner verifies.
It is not a token problem and not a guild permission problem.
What it looks like
{
"message": "You need to verify your account in order to perform this action",
"code": 40002
}Why it happens
- OAuth2 user being added to a guild whose verification level requires a verified email or phone
- Developer account that owns the application has not verified its email
- Bot performing an action in a guild whose verification level the bot owner's account does not meet
How to fix Discord error 40002
- 1For OAuth2 flows, tell the user to verify their Discord account (email or phone, as the guild requires) and retry
- 2Verify the email address on the developer account that owns the application, then retry
- 3Check the guild's verification_level via GET /guilds/{id}; levels 1-4 require progressively more of the joining account
- 4If adding users programmatically is critical, consider lowering the guild's verification level or providing a normal invite link as a fallback
How to stop it recurring
Verify the owner account before creating production applications, and when building guilds.join flows, read the target guild's verification level up front and explain the requirement to users before they click. Treat 40002 as a user-facing instruction rather than a bug.
Because the remedy is on the account side, the engineering work is all in messaging: detect 40002, explain the verification requirement, and link the user to their settings. Guild verification levels are part of the guild object described alongside the other server fields on the Discord limits page; a banned rather than unverified user fails the same join with 40007.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 40002 - quick answers
What does Discord error 40002 mean?
The acting account has not completed Discord's account verification (typically email verification, sometimes phone verification depending on the server's verification level) and the server or Discord itself requires it for the action. For bots this surfaces in two ways.
How do I fix Discord error 40002?
1. For OAuth2 flows, tell the user to verify their Discord account (email or phone, as the guild requires) and retry 2. Verify the email address on the developer account that owns the application, then retry 3. Check the guild's verification_level via GET /guilds/{id}; levels 1-4 require progressively more of the joining account 4. If adding users programmatically is critical, consider lowering the guild's verification level or providing a normal invite link as a fallback
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.