Sealearn’s league system divides learners into competitive rooms of up to 30 users. Each Monday a new week begins, XP counters reset, and every user is placed into a room matching their current tier. At the end of the week the top 10 performers in each room are promoted to the next tier, while the bottom 10 are demoted. There are nine tiers in total, ranging from Bronze up to Heroic. The endpoints below let clients display a user’s current standing and — for administrators — trigger the processing cycle on demand.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DerBasilisk/SEA-ServicioEvaluaconAsistida/llms.txt
Use this file to discover all available pages before exploring further.
All routes are mounted under
/api/leagues and require a valid JWT. The POST /process route additionally requires the isAdmin middleware; calling it without an admin account returns 403 Forbidden.The LeagueRoom Model
ALeagueRoom document represents a single competitive room for one week. A new set of rooms is created automatically at the start of each week when users first request their league data.
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Unique document ID. |
league | string | Tier key: one of the 9 valid league slugs. |
weekStart | Date | The Monday 00:00:00 UTC that marks the start of this room’s week. |
roomNumber | number | Sequential number distinguishing multiple rooms at the same tier in the same week. |
members | array | Embedded member subdocuments (see below). |
processed | boolean | true after the weekly promotion/demotion cycle has run for this room. |
createdAt | Date | Auto-managed Mongoose timestamp. |
| Field | Type | Description |
|---|---|---|
user | ObjectId → User | Reference to the member’s User document. |
xpEarned | number | XP accumulated by this member during the current week (default 0). |
promoted | boolean | Set to true when the member is promoted at week’s end. |
demoted | boolean | Set to true when the member is demoted at week’s end. |
joinedAt | Date | When the member was added to this room. |
League Tiers
Sealearn has nine tiers arranged in ascending order of prestige. Moving up requires finishing in the top 10 of your room; finishing in the bottom 10 drops you to the previous tier (Bronze users cannot be demoted further).| Order | Key | Display Name | Icon | Color |
|---|---|---|---|---|
| 0 | bronze | Bronce | 🥉 | #cd7f32 |
| 1 | silver | Plata | 🥈 | #c0c0c0 |
| 2 | gold | Oro | 🥇 | #ffd700 |
| 3 | sapphire | Zafiro | 💙 | #0f52ba |
| 4 | emerald | Esmeralda | 💚 | #50c878 |
| 5 | diamond | Diamante | 💎 | #b9f2ff |
| 6 | master | Maestro | 🔮 | #9b59b6 |
| 7 | champion | Campeón | 👑 | #f1c40f |
| 8 | heroic | Heroico | ⚔️ | #ff4444 |
Endpoints
GET /api/leagues/me
Returns the authenticated user’s current league room, including a sorted member list and contextual rank information. If the user has not yet been assigned to a room for the current week, the server creates one automatically before responding. Themembers array is sorted by xpEarned descending so the client can render the leaderboard directly. The response also includes the promotion and demotion zone boundaries, and the number of days remaining until the next weekly reset.
true on success.GET /api/leagues/info
Returns metadata for all nine league tiers, along with the authenticated user’s current tier key. Use this endpoint to render a tier progression screen or highlight the user’s position in the full ladder.true on success.POST /api/leagues/process
Admin only. Forces an immediate run of the weekly league processing cycle. In normal operation this cycle runs automatically on the server’s scheduled cron job every Monday. This endpoint is intended for testing and manual intervention. The cycle iterates over every unprocessedLeagueRoom for the current week: the top 10 members (by xpEarned) are promoted to the next tier and the bottom 10 are demoted to the previous tier. Bronze members cannot be demoted. Heroic members cannot be promoted further. After processing, the room’s processed flag is set to true so it is not processed again.
Calling this endpoint while the week is still in progress will promote and demote users based on their XP at the time of the call. For production use, this is intended to be called only on Monday when the week has concluded.
true on success.Summary of how many rooms were processed (e.g.
"Procesadas 47 salas").