Skip to Content

Leagues

A League represents a season or competition period within your organization. It contains divisions, teams, games, and registrations.

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

Endpoints

MethodPathAuthDescription
GET/api/v1/leaguesRecommendedList all leagues for your organization
GET/api/v1/leagues/:idRecommendedGet a single league by ID
POST/api/v1/leaguesRequiredCreate a new league
PUT/api/v1/leagues/:idRequiredUpdate a league

Allowed ?include= roots: tournament, paymentProduct, organization. By default, tournament is returned as an ObjectId — pass ?include=tournament to get it populated. See Query Parameter: ?include=.

Fields

FieldTypeDescription
_idObjectIdUnique identifier
namestringLeague name (e.g. “Spring Soccer 2026”)
contestTypestringContest type — Mens / Womens / Co-ed / Open. Default: "season"
prioritynumberDisplay sort order
sportsstring[]Sports played in this league. Default: []
startDatedateLeague start date. Default: now
endDatedateLeague end date (optional)
activebooleanWhether the league is active. Default: true
configConfigSchemaLeague-level configuration (see Config Hierarchy)
tournamentObjectIdParent tournament (ref: Tournament)
paymentProductObjectIdDefault payment product (ref: PaymentProduct)
organizationObjectIdOwning organization (ref: Organization)
createddateCreation timestamp
updateddateLast update timestamp

Create a League

curl -X POST https://api.staty.io/api/v1/leagues \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "name": "Spring Soccer 2026", "contestType": "coed", "sports": ["soccer"], "startDate": "2026-04-01", "endDate": "2026-06-30", "organization": "org_id_here" }'

Response:

{ "success": true, "data": { "_id": "league_abc123", "name": "Spring Soccer 2026", "contestType": "coed", "sports": ["soccer"], "startDate": "2026-04-01T00:00:00.000Z", "endDate": "2026-06-30T00:00:00.000Z", "active": true, "organization": "org_id_here", "created": "2026-03-15T10:00:00.000Z" } }

Update a League

curl -X PUT https://api.staty.io/api/v1/leagues/league_abc123 \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "active": false }'

List Leagues

curl https://api.staty.io/api/v1/leagues \ -H "Authorization: Bearer sk_live_..."
Last updated on