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
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/v1/leagues | Recommended | List all leagues for your organization |
| GET | /api/v1/leagues/:id | Recommended | Get a single league by ID |
| POST | /api/v1/leagues | Required | Create a new league |
| PUT | /api/v1/leagues/:id | Required | Update 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
| Field | Type | Description |
|---|---|---|
_id | ObjectId | Unique identifier |
name | string | League name (e.g. “Spring Soccer 2026”) |
contestType | string | Contest type — Mens / Womens / Co-ed / Open. Default: "season" |
priority | number | Display sort order |
sports | string[] | Sports played in this league. Default: [] |
startDate | date | League start date. Default: now |
endDate | date | League end date (optional) |
active | boolean | Whether the league is active. Default: true |
config | ConfigSchema | League-level configuration (see Config Hierarchy) |
tournament | ObjectId | Parent tournament (ref: Tournament) |
paymentProduct | ObjectId | Default payment product (ref: PaymentProduct) |
organization | ObjectId | Owning organization (ref: Organization) |
created | date | Creation timestamp |
updated | date | Last 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