Skip to Content
API ReferenceDivisions

Divisions

Divisions belong to a league and hold teams. Each division tracks its own standings, schedule, and configuration.

Endpoint: /api/v1/divisions Required scope: read:leagues (read) / admin (write)

Endpoints

MethodPathAuthDescription
GET/api/v1/divisions?league=:idRecommendedList all divisions for a league
GET/api/v1/divisions/:idRecommendedGet a single division (includes standings)
POST/api/v1/divisionsRequiredCreate a division within a league
PUT/api/v1/divisions/:idRequiredUpdate a division

Allowed ?include= roots: league, organization, paymentProduct. By default, league is returned as an ObjectId string; pass ?include=league to get it as a nested object. See Query Parameter: ?include=.

Division Fields

FieldTypeDescription
_idObjectIdUnique identifier
namestringDivision name (required)
organizationObjectIdOwning organization (ref: Organization)
leagueObjectIdParent league (ref: League)
sportsstring[]Sports for this division. Default: []
prioritynumberDisplay sort order
paymentProductObjectIdPayment product override (ref: PaymentProduct)
configConfigSchemaDivision-level configuration (highest precedence)
strengthLevelnumberSkill level indicator
startDatedateDivision start date
endDatedateDivision end date
createddateCreation timestamp
updateddateLast update timestamp

ConfigSchema Fields

Division config overrides league, tournament, and registration config. See Config Hierarchy for details.

FieldTypeDefaultDescription
requirePlayersboolean—Teams must add players to complete registration
hideTeamsboolean—Hide team names from public views
hideSchedulesboolean—Hide the public Schedule tab and its content. Resolves through the config hierarchy; unset inherits from the contest/tournament/registration and defaults to visible.
hideStandingsboolean—Hide the public division Standings tab
showStatsboolean—Whether stats are visible to the public. Resolves through the config hierarchy; unset falls through and defaults to show. (The legacy org-level hideStats fallback was retired.)
gameStatsRecord<sport, string[]>—Sport-keyed raw per-game stat keys shown in box scores, game logs, and the admin entry grid (e.g. { basketball: ['points','totalRebounds'] }). Public aggregate columns are derived from this via inferDisplayStats. Resolves through the config hierarchy.
excludeTeamNameboolean—Show player names instead of a team name (the team-name field is skipped at registration and a name is auto-generated). Unset resolves to true for individual/doubles sports (pickleball, golf, tennis) and false otherwise; an explicit value at any tier wins.
minPlayersnumber—Minimum players per team
maxPlayersnumber—Maximum players per team
gameDurationInMinutesnumber—Default game duration
requireCoachesboolean—Teams must add coaches
requireTeamRepresentativesboolean—Teams must add team representatives
minTeamRepresentativesnumber—Minimum team representatives
maxTeamRepresentativesnumber—Maximum team representatives
minCoachesnumber—Minimum coaches
maxCoachesnumber—Maximum coaches
capacitynumber—Max teams. Unset inherits from the contest/tournament/registration; 0 means no limit at this level and also falls through to the parent.
waitlistCapacitynumber0Waitlist spots (0 = no waitlist)
autoPromoteboolean—Auto-promote waitlisted teams when a spot opens. Unset inherits.
promotionPaymentWindowHoursnumber—Controls FIFO ordering window for promoted teams (does not gate seating). Unset inherits, then falls back to 48.
disableSyncboolean—Disable automatic sync
adminsstring[][]Additional admin user IDs
tiebreakersobject—Tiebreaker rules per sport (basketball, football, baseball, soccer)
gateByStartDateboolean—Registration-level only (read directly off registration.config, not via hierarchy). When true, the registration is publicly viewable but registrations are blocked until registration.startDate. Managed via isBeforeRegistrationStart() in registrationSchedule.ts. Default off.

Create a Division

curl -X POST https://api.staty.io/api/v1/divisions \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "name": "Competitive", "league": "league_abc123", "config": { "capacity": 12, "minPlayers": 7, "maxPlayers": 15, "gameDurationInMinutes": 50 } }'

Response:

{ "success": true, "data": { "_id": "div_def456", "name": "Competitive", "league": "league_abc123", "config": { "capacity": 12, "minPlayers": 7, "maxPlayers": 15, "gameDurationInMinutes": 50, "waitlistCapacity": 0, "autoPromote": false, "promotionPaymentWindowHours": 48 }, "created": "2026-03-15T10:00:00.000Z" } }

Division config takes the highest precedence in the config hierarchy. See Config Hierarchy for how it interacts with league, tournament, and registration config.

Last updated on