Errors

Every error response has the shape:

{ "error": { "code": "STRING_CODE", "message": "human-readable, non-contractual" } }

Match your integration's error handling against error.code. The full set:

MISSING_TOKEN        401  No Authorization: Bearer <token> header sent.
INVALID_TOKEN         403  Token doesn't match any active token.
TOKEN_REVOKED          403  Token was explicitly revoked from the dashboard.
SUBSCRIPTION_INACTIVE  402  The guild's premium subscription has lapsed.
INSUFFICIENT_SCOPE     403  Token doesn't carry the scope this route needs.
VALIDATION_ERROR       400  Request params/body failed validation.
MISSING_IDEMPOTENCY_KEY 400  A route requiring Idempotency-Key didn't get one.
IDEMPOTENCY_KEY_IN_PROGRESS 409  The same key is already being processed by a concurrent request.
IDEMPOTENCY_KEY_REUSED 409  The same key was reused with a different method/path/body.
ITEM_NOT_FOUND         404  No matching item in this guild.
STOCK_NOT_FOUND        404  No matching stock in this guild.
USER_NOT_FOUND         404  No profile for this user in this guild.
GUILD_CONFIG_NOT_FOUND 404  No config document for this guild.
LOTTERY_NOT_FOUND      404  No lottery configured for this guild.
RATE_LIMITED           429  Too many requests.
SERVER_ERROR           500  Unexpected server error.

Did this page help you?