{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/studiomeyer-academy/json-schema/studiomeyer-academy-api-error-schema.json",
  "title": "ApiError",
  "description": "Stable Academy error. Branch on code or slug, never on the localized message or hint.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/studiomeyer-academy-openapi.json#/components/schemas/ApiError",
  "type": "object",
  "required": [
    "code",
    "slug",
    "message",
    "hint",
    "documentation_url"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "enum": [
        1000,
        1001,
        1002,
        1003,
        1004,
        1005,
        1100,
        1101,
        1102,
        1103,
        1104,
        1105,
        1106,
        1107,
        1200,
        1201,
        2001,
        2002,
        2003,
        2004,
        2005,
        2006,
        2007,
        3001,
        3002,
        3003,
        4002,
        4003,
        4004,
        4005,
        4006,
        5001,
        5002,
        5003,
        5004,
        5005,
        5006,
        9000,
        9001,
        9002
      ]
    },
    "slug": {
      "type": "string",
      "enum": [
        "auth_required",
        "invalid_token",
        "insufficient_scope",
        "credits_spend_not_granted",
        "account_suspended",
        "session_required",
        "validation_failed",
        "not_found",
        "idempotency_key_reused",
        "conflict",
        "idempotency_key_required",
        "idempotency_in_flight",
        "confirmation_required",
        "locale_not_supported",
        "rate_limited",
        "tutor_limit_reached",
        "path_not_found",
        "module_not_found",
        "lesson_not_found",
        "library_item_not_found",
        "content_type_unknown",
        "premium_required",
        "content_dormant",
        "lesson_already_completed",
        "quiz_not_available",
        "note_not_found",
        "insufficient_credits",
        "bonus_credits_not_allowed",
        "already_unlocked",
        "price_changed",
        "outcome_unknown",
        "package_not_found",
        "draft_consent_required",
        "package_deprecated",
        "lockfile_invalid",
        "local_changes_detected",
        "script_consent_required",
        "internal",
        "not_implemented",
        "temporarily_unavailable"
      ]
    },
    "message": {
      "type": "string",
      "minLength": 1
    },
    "hint": {
      "type": "string",
      "minLength": 1
    },
    "documentation_url": {
      "type": "string",
      "format": "uri"
    },
    "details": {
      "type": "object"
    }
  }
}