tether developers
Contents

Docs

Errors

What an error answer looks like, and the codes a bot meets most often.

Every error answer is JSON with Discord's shape:

{
  "code": 50035,
  "message": "Invalid Form Body",
  "errors": {
    "content": { "_errors": [{ "code": "BASE_TYPE_BAD_LENGTH", "message": "…" }] }
  }
}

code is the number to switch on. Codes below 90000 are Discord's own, with the same meaning; codes from 90000 are tether's. message is for people to read and may change. errors appears with 50035 (Invalid Form Body): nested by field name, with array positions as keys ("embeds": {"0": {…}}), and a stable code string per problem (BASE_TYPE_REQUIRED, BASE_TYPE_BAD_LENGTH, BASE_TYPE_INVALID, BASE_TYPE_CHOICES, BASE_TYPE_UNKNOWN_KEYS, or a route's own such as USERNAME_ALREADY_TAKEN or NAME_NOT_ALLOWED).

The Content-Type is exactly application/json, errors included, as Discord's is (discord.py decodes a body only when it is that whole string).

Statuses

Status When
400 The request is wrong: a field outside its limits, an action the target does not allow.
401 No valid token (40001), or an app token on a route that takes none.
403 The token is fine and the action is refused: a missing permission, a route for people, a rule.
404 There is no such thing, or you are not allowed to know: a server you are not in is 404, not 403.
409 A conflict: a bot already in the server (90221), a player taken by another bot (90214).
413 A file or a whole upload is over the limit (40005).
415 The body is of a type the route does not read (a non-empty body on a route that takes none).
429 Rate limited: Rate limits.
504 An interaction was not answered in 3 seconds (90210).

A POST, PUT or PATCH with no body works whatever its Content-Type; invalid JSON is 400 50109.

The ones a bot meets

Code Name Usually means
10003 Unknown Channel The channel does not exist, or the bot is not in its server.
10004 Unknown Guild Same, for a server.
10008 Unknown Message The message was deleted, or is in another channel.
10062 Unknown Interaction You answered after 3 seconds, or the token has lapsed (15 minutes).
20001 Bots cannot use this endpoint A route for people (creating servers, bots and invites…).
20002 Only bots can use this endpoint A route for bots (/applications/@me, application commands) called with a person's token.
20016 Slow mode rate limit The channel has slow mode and its wait is not over. retry_after says how long.
30032 Maximum application commands reached 100 / commands, 15 user commands or 15 message commands in one scope.
40005 Request entity too large A file or all the files together are over the limit (413).
40060 Interaction already acknowledged You answered the same interaction twice.
50001 Missing Access The bot cannot see the channel.
50006 Cannot send an empty message No text, embed, file or poll.
50013 Missing Permissions The bot lacks a permission, or is not above the target's highest role.
50028 Invalid Role A bot's managed role cannot be given, taken, or deleted while the bot is in the server.
50035 Invalid Form Body A field is missing, the wrong type or outside its limits; read errors.
50083 Thread archived The thread is archived.
160005 Thread is locked Only people who manage threads may write in it.
90003 Rate limited The 429 code. Rate limits.
90005 Unsupported file type An executable, or a type tether refuses.
90030 Voice disabled The server has no LiveKit.
90031 Voice channel full The channel's user_limit is reached.
90032 Not in the voice channel You are not connected to that voice channel (or call) right now.
90033 Call is encrypted The call is encrypted and the request had no e2ee_key (an app too old for it).
90034 No bots in encrypted calls Bots can't join an encrypted voice channel.
90035 Encrypted call full An encrypted call holds at most 50 people.
90036 Not in an encrypted call That isn't available in an encrypted call (stills of a share or camera).
90170 Channel locked A moderator locked the channel.
90210 Bot did not respond What the person sees when you miss the 3 seconds.
90211 Interaction not acknowledged A follow-up before the first answer.
90212–90218 The player The music player lists them.
90220 Bot not public The bot is private; only its maker may add it.
90221 Bot already in guild The bot is in that server already.
90261 Link blocked A link known to be harmful; the message was not sent (blocked_message has it).
90262 Sending paused A new account sent too much to too many places; wait retry_after seconds.

The complete table, with every code tether knows and the routes that answer it, is in the API reference.

The token endpoints are different

Get Tokens and Revoke Token answer errors the OAuth way, RFC 6749's {"error": "invalid_grant", "error_description": "…"}, as Discord's token endpoint does.