Zrzur Developers

Errors

Every error type the API can return, with its cause and its fix.

Error format

Every error is JSON with a type, sometimes with more fields:

{ "type": "MissingPermission", "permission": "ManageMessages" }
{ "type": "FailedValidation", "error": "content: length must be between 0 and 2000" }
{ "type": "FileTooLarge", "max": 20000000 }

Branch on type, never on the text. Types are stable: they are never renamed or removed. New ones can appear in newer servers, so treat an unknown type as a general failure.

What to do with an error

StatusMeaningWhat to do
400, 422The request is wrongFix it. The same request fails again
401The token is wrongStop the bot and check the token
403The bot may not do thisTell the person. Do not retry
404It is goneForget it
409A conflictFetch the current state
429Too many requestsSee Rate limits
5xxOur side failedRetry with a growing delay, three to five times

Errors raised by the web server itself (no token, unknown route, a body that is not JSON) are JSON too. Check the status before you parse a body, because a proxy in between can still answer with HTML.

Is the bot in that server?

A bot sees only the servers it was installed in. For a server it is not in, the answers differ by route:

CallAnswer
GET /servers/{target}404 NotFound
GET /channels/{target} for one of its channels404 NotFound
POST /channels/{target}/messages for one of its channels403 MissingPermission

So a 403 MissingPermission when your bot writes to a channel id someone gave it can mean that the bot is not installed there. Ask GET /channels/{target}: 404 NotFound means the bot is not in that server (or the channel does not exist), so install the bot first, with the invite link from the Developer Portal. A 403 MissingPermission there means the bot is in the server and cannot see the channel: a private channel needs View Channel for one of the bot's roles.

Errors a bot can get

TypeHTTPCauseFix
UnknownUser404The user does not exist or the bot cannot see them.Check the id. The person may have deleted their account.
DirectMessagesRestricted403The person's privacy settings refuse this DM.Do not retry. Reach them in a server channel.
DirectMessagesPaused403The server paused DMs between its members.Do not retry. A moderator lifts the pause.
BlockedByOther403The person blocked the bot.Do not retry.
OfficialAccount403An official Zrzur account cannot be replied to, reacted to, pinned or reported.Do not retry.
UnknownChannel404The channel is gone or the bot cannot see it.Check the id and that the bot has View Channel.
UnknownMessage404The message is gone, or it is not in this channel.Treat it as deleted.
UnknownAttachment400A file id in the body does not exist or was already used.Upload the file again. Each upload can be used once.
CannotDeleteMessage403The message cannot be deleted, for example one this interaction did not create.Delete only what your bot wrote, or get Manage Messages.
CannotEditMessage403A bot can only edit its own messages.Send a new message instead.
CannotJoinCall400The channel takes no calls.Use a voice channel.
TooManyAttachments400The message has more files than max.Send the files in several messages.
TooManyEmbeds400The message has more embeds than max.Send fewer embeds.
TooManyReplies400The message replies to more messages than max.Reply to fewer messages.
TooManyChannels400The server reached its channel limit, max.Delete a channel first.
TooManyChannelWebhooks400The channel reached its limit of webhooks.Delete a webhook in this channel.
TooManyServerWebhooks400The server reached its limit of webhooks.Delete a webhook in this server.
RateLimited429A webhook sent too much. The body has retry_after in milliseconds.Wait that long, then send again.
ForumThreadRequired400A webhook posted to a forum without a thread.Send thread_id, or thread_name to start one.
ThreadsDisabled403The server switched threads off. What exists stays readable.Do not retry. Only the server can switch them back on.
ForumsDisabled403The server switched forums off. What exists stays readable.Do not retry. Only the server can switch them back on.
PluginsDisabled403Plugins are switched off on this server. No plugin route answers while they are off.Do not retry. Plugins come back only when the server turns them on.
EmptyMessage422The message has no content, embeds, attachments or components.Send something.
PayloadTooLarge422The message is over a size limit.Shorten the text or the embeds.
AlreadyPinned400The message is already pinned.Ignore it.
NotPinned400The message is not pinned.Ignore it.
InSlowmode429The channel has slowmode and the bot wrote too soon. The body has retry_after.Wait, or give the bot Bypass Slowmode. This is a refusal, not a rate limit.
UnknownServer404The server does not exist or the bot is not in it.Check the id. Forget a server when you get ServerDelete.
InvalidRole404The role does not exist in this server.Fetch the roles again.
Banned403This user is banned from the server.A moderator removes the ban first.
AlreadyInServer409The bot is already in this server.Nothing to do.
CannotTimeoutYourself400The target of the timeout is the bot itself.Pick another member.
TooManyEmoji400The server reached its emoji limit, max.Delete an emoji first.
TooManyRoles400The server reached its role limit, max.Delete a role first.
UnknownApplication404The application does not exist.Check the id: an application id is the bot's user id.
ApplicationNotInstalled403Someone used a bot that is not in this server.Install the bot in the server.
ApplicationOffline503The bot was suspended or switched off, so it receives nothing.Its owner contacts Zrzur support.
SignedDeliveryRejected400Your HTTP interaction address failed its test. reason says why.See Interactions over HTTP.
UnknownCommand404The command id is unknown, or it was deleted.Fetch the command list.
CommandAlreadyExists409A command with this name and type already exists in this scope.Use PUT to replace the list, or edit the command.
TooManyCommands400The limit of max commands of this type in one scope is reached.Delete commands first.
UnknownInteraction404The interaction id or token is wrong.Use the values from InteractionCreate as they are.
InteractionExpired410The 3 seconds to acknowledge, or the 15 minutes of the token, are over.Acknowledge sooner. Use DeferredMessage for slow work.
InteractionAlreadyAcknowledged409This interaction already has its first answer.Use a follow-up, or edit the original.
TooManyFollowups400The limit of max follow-ups for one interaction is reached.Edit a message, or send a normal message.
IsBot400This route is for people. Bots are refused.Do it another way. The reference marks what bots can use.
BotIsPrivate403Only the owner can install a private bot.Sign in as the owner, or make the bot public.
MissingPermission403The bot lacks the permission named in permission.Give the bot that permission, or tell the person.
MissingUserPermission403The person the bot acts for lacks the permission in permission.Tell the person.
MissingIntent403The route or connection needs the intent named in intent.Switch it on in the Developer Portal and ask for it when you connect.
MasqueradeNameTaken400The masquerade name copies another member.Choose another name.
BotNeedsVerification403An unverified bot stops at 100 servers.Ask for verification.
VerificationRequired403The server's verification level refuses this member for now. requirement says why.Wait, or ask the server's moderators.
AutoModBlocked403The server's AutoMod rule rule refused the message.Change the text. Do not retry the same text.
RulesNotAccepted403The member has not accepted the server's rules.Tell them to accept the rules.
InvitesPaused403The server paused invites.Do not retry. A moderator lifts the pause.
NotElevated403The target ranks at or above the bot, or the role is above the bot's top role.Move the bot's role higher.
NotPrivileged403The bot's rank is too low for this change.Move the bot's role higher.
CannotGiveMissingPermissions403The bot tried to give a permission it does not have itself.Give the bot that permission first.
NotOwner403Only the owner can do this.Ask the owner.
IsElevated403The target ranks too high for this.Pick a lower target.
InternalError500Something failed on the server.Wait and retry with a growing delay. Report it if it stays.
InvalidOperation400The request is not valid in this state, for example a Modal as the answer to a form.Check the rules of this route.
InvalidCredentials401The token, password or ticket is wrong.Check it.
InvalidProperty400A field combination is not allowed here.Check the request body.
InvalidSession401The token is missing or wrong, or the bot was suspended.Stop and check the token. Retrying does not help.
NotAuthenticated401The route needs a token and got none.Send x-bot-token.
DuplicateNonce409The same nonce was used for a different request.Use a new value for each new message.
NotFound404The route or the object does not exist.Check the path and the ids.
NoEffect400The request changes nothing.Ignore it.
FailedValidation400The body breaks a limit or a rule. error says which in one line, and fields lists each field with its rule.Fix the body. Do not retry the same request.
LiveKitUnavailable400Voice is not available on this server.Try again later.
NotAVoiceChannel400The channel is not a voice channel.Use a voice channel.
AlreadyConnected400The bot is already in this voice channel.Disconnect first.
NotConnected400The member is not in a voice channel.Check the voice states first.
UnknownNode400The voice node does not exist.Take a name from features.livekit.nodes of GET /.
FeatureDisabled400This server has the feature named in feature switched off.Do not retry. Self-hosted servers switch it on in their configuration.
HeaderTooLarge400A header is too large, for example the audit log reason.Shorten it.
ProxyError400The link or media proxy could not fetch the address.Check that the address is public.
FileTooSmall422The uploaded file is empty.Send a file with content.
FileTooLarge422The file is over the limit of its tag, max.Send a smaller file.
FileTypeNotAllowed400This tag takes images only.Send an image, or use attachments.
ImageProcessingFailed500The image could not be read.Send a valid image.
NoEmbedData400The link has no preview data.Ignore it.
MissingHeaders400A required header is missing.Send x-bot-token, and content-type with a body.
OperationFailed500The action could not finish.Retry once, later.
IncorrectData400The stored data does not match. with names it.Fetch the object again.
DatabaseError500A database call failed on the server.Wait and retry with a growing delay.
VosoUnavailable400The old voice service is unavailable.Use LiveKit voice.
RenderFail500The server could not render a template.Retry later.
LabelMe500An unlabelled server error.Retry later. Report it if it stays.
ContactSupport400The server wants a person to contact support. msg says why.Show the message to the owner.
InvalidFlagValue400A flag has a value the server does not know.Check the flags.
TooManySounds400The server's soundboard is full.Remove a sound first. max is the limit.
SoundAlreadyAdded409This library sound is on the server's soundboard already.Nothing to do.
SoundLibraryUnavailable503The sound library is not ready yet.Try again in a minute.
TooManySpeakers400The stage has as many speakers as it may have.Move a speaker back to the audience first. max is the limit.
PollEnded409The poll is over: no more votes, and it cannot be ended again.Do not retry.

Errors of account routes

Bots rarely see these. They belong to routes for people, such as signing in.

TypeHTTPCauseFix
AlreadyOnboarded403The account already has a username.Used by the app only.
AgeNotDeclared403The account has not declared its age.People only: finish it in the app.
UsernameTaken409The username is taken.Choose another name.
InvalidUsername400The username has characters that are not allowed.Use letters, digits, ., - and _.
DiscriminatorChangeRatelimited429The name tag changed too recently.Wait.
AlreadyFriends409The users are friends already.Bots have no friends.
AlreadySentRequest409A friend request is pending.Bots have no friends.
Blocked409The user is blocked.People only.
NotFriends403This needs a friendship.Bots have no friends.
GroupInvitesRestricted403The person refuses group invites.People only.
TooManyPendingFriendRequests400Too many friend requests are pending.People only.
CannotRemoveYourself400The group owner cannot remove themselves.People only.
GroupTooLarge403The group is full.People only.
AlreadyInGroup409The user is already in the group.People only.
NotInGroup404The user is not in the group.People only.
CantCreateServers403This account cannot create servers. Bots never can.Create the server as a person.
TooManyServers400The account reached its server limit.Leave a server first.
VanityUnavailable403The server cannot have a custom address.People only.
VanityTaken409The custom address is taken.Choose another one.
VanityReserved400The custom address is reserved.Choose another one.
VanityPaused410The custom address is paused.Ask support.
TooManyCommunityItems400The creator reached the limit of items.Not for bots.
MissingPlatformPermission403This needs a Zrzur staff permission.Not for bots.
ProfileTextFiltered422The platform word list stopped this text.Not for bots.
CommunityItemConflict409The gallery item changed meanwhile.Not for bots.
TooManyReports429Too many reports in a short time.Wait.
SafetyCaseConflict409The safety case changed meanwhile.Not for bots.
TooManySupercharges400The limit of Wings is reached.Not for bots.
TooManyBotCreations429The account made 7 bots in the last 7 days.Wait until resets_at, then create the bot.
PromotionSlotsFull409All promotion slots are taken.Not for bots.
NotOnDiscover400The server is not on Discover.Not for bots.
ReachedMaximumBots400The account reached its limit of bots.Delete an old bot first.
IsNotBot400This route is for bots.Send x-bot-token.
CannotReportYourself400People cannot report themselves.Not for bots.
CaptchaFailed400The captcha failed.People only.
BlockedByShield400The sign-up shield refused the request.People only.
UnverifiedAccount403The account's e-mail is not verified.Verify the e-mail.
EmailFailed500The e-mail could not be sent.Try again later.
InvalidToken401The link or code is wrong or has expired.Ask for a new one.
MissingInvite400This server needs an invite to sign up.People only.
InvalidInvite400The invite is wrong.Ask for a new one.
CompromisedPassword400The password is on a list of leaked passwords.Choose another one.
ShortPassword400The password is too short.Choose a longer one.
LockedOut403Too many failed sign-ins.Wait.
TotpAlreadyEnabled400The authenticator is already on.People only.
DisallowedMFAMethod400This check is not allowed here.People only.
AgeRequirementNotMet403The account is too young for this.People only.
AgeChangeNotAllowed403The age cannot be changed.People only.
AgeRestricted403The content is limited by age.People only.
TooManyServerEvents400The server has as many scheduled events as it may have.People only.
ForwardMatureContent403A message from a mature channel can only be forwarded into another mature channel.People only: bots cannot forward.

OAuth2 errors

POST /oauth2/token follows the OAuth2 standard and answers with error and error_description instead of type. See OAuth2.

Next