API Reference
Welcome to the Leaguely API. Our API is organized around REST, uses resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Base URL:
https://api.leaguely.app/api/mobileAuthentication
Sign In (Magic Link)
POSTInitiate the Magic Link sign-in process. An email will be sent to the user with a secure link to complete the authentication. This is the primary authentication method for the mobile app.
PATH/auth/signin
Parameters
email
string
REQUIRED
The user's registered email address.
redirectUri
string
OPTIONAL
Optional URI to redirect the user to after successful sign-in.
inviteToken
string
OPTIONAL
Optional organization invite token for new users.
BASH
Sign Out
POSTSign out the current user and invalidate their session.
PATH/auth/signout
BASH
Get Profile
GETRetrieve detailed information about the currently authenticated user, including their name, email, and preferences.
PATH/profile
BASH
Update Profile
PUTUpdate the authenticated user's profile information.
PATH/profile
Parameters
name
string
OPTIONAL
Full name of the user.
notifications
object
OPTIONAL
Notification preferences.
BASH
Admin (Super Admin)
List Invites
GETList all active organization invites. Restricted to super admins.
PATH/admin/invites
BASH
Create Invite
POSTGenerate a new organization invite link.
PATH/admin/invites
Parameters
email
string
REQUIRED
Email to send the invite to (optional if just generating link).
BASH
Revoke Invite
DELETERevoke and delete an active invite.
PATH/admin/invites/{id}
BASH
Organizations
List Organizations
GETReturns a list of all organizations that the authenticated user is a member of.
PATH/organizations
BASH
Get Organization
GETRetrieves the details of an organization using its unique slug.
PATH/organizations/{slug}
Parameters
slug
string
REQUIRED
The unique slug identifier for the organization.
BASH
Create Organization
POSTCreate a new organization using a valid invite token.
PATH/organizations
Parameters
name
string
REQUIRED
Name of the new organization.
inviteToken
string
REQUIRED
Valid invite token from a super admin.
BASH
Delete Organization
DELETEPermanently delete an organization. Restricted to super admins.
PATH/organizations/{slug}
Parameters
organizationId
string
REQUIRED
ID of organization to delete.
confirmName
string
REQUIRED
Must match organization name to confirm.
BASH
Leagues
List Leagues
GETReturns a list of all leagues the authenticated user belongs to. Includes both admin and player memberships.
PATH/leagues
BASH
League Dashboard
GETRetrieves a summary for the league dashboard, including the next scheduled match, recent activity, and quick stats.
PATH/leagues/{slug}/dashboard
BASH
Get Configuration
GETFetch the full configuration settings for the league, including scoring rules, handicap settings, and schedule preferences.
PATH/leagues/{slug}/configuration
BASH
Check Slug Availability
POSTChecks if a proposed league slug is unique and available for use.
PATH/leagues/check-slug
Parameters
slug
string
REQUIRED
The slug to check for availability.
BASH
Update Configuration
PATCHUpdate league settings such as scoring rules, handicap system, and schedule preferences.
PATH/leagues/{slug}/configuration
Parameters
handicapSystem
string
OPTIONAL
e.g. 'usga', 'custom'
scoringRules
object
OPTIONAL
Detailed scoring configuration.
BASH
Delete League
POSTPermanently delete a league. Requires confirmation.
PATH/leagues/delete
Parameters
leagueId
string
REQUIRED
ID of the league to delete.
confirmName
string
REQUIRED
Must match league name exactly.
BASH
Impersonate Player
POSTAdmin only. Start a session acting as another user for debugging or support.
PATH/leagues/{slug}/impersonate
Parameters
userId
string
REQUIRED
ID of the user to impersonate.
BASH
Teams
List Teams
GETReturns a list of all teams competing in the specified league.
PATH/leagues/{slug}/teams
BASH
Create Team
POSTCreate a new team in the league. You can optionally add members immediately.
PATH/leagues/{slug}/teams
Parameters
name
string
REQUIRED
Name of the team.
memberIds
array<string>
OPTIONAL
List of member IDs to add to the team.
BASH
Get Team
GETRetrieves detailed information about a specific team, including its full roster of players.
PATH/leagues/{slug}/teams/{teamId}
BASH
Delete Team
DELETEPermanently delete a team from the league. This does not remove the players from the league.
PATH/leagues/{slug}/teams/{teamId}
BASH
Add Member to Team
POSTAdd an existing league member to a team.
PATH/leagues/{slug}/teams/{teamId}/members
Parameters
leagueMemberId
string
REQUIRED
ID of the league member to add.
BASH
Remove Member from Team
DELETERemove a member from a team without deleting the team or the member.
PATH/leagues/{slug}/teams/{teamId}/members
Parameters
leagueMemberId
string
REQUIRED
ID of the league member to remove.
BASH
Players
List Players
GETReturns a directory of all players in the league, including active players, subs, and admins.
PATH/leagues/{slug}/players
BASH
Invite Player
POSTInvite a new player to the league via email. This endpoint adds the player to the league and sends a notification.
PATH/leagues/{slug}/players
Parameters
email
string
REQUIRED
Email address of the player to invite.
firstName
string
OPTIONAL
First name of the player.
lastName
string
OPTIONAL
Last name of the player.
role
string
OPTIONAL
Role for the new member ('admin', 'player', or 'sub').
BASH
Update Player
PATCHUpdate a player's role, handicap, or profile details. Admins can update any player; users can update their own profile.
PATH/leagues/{slug}/players
Parameters
memberId
string
REQUIRED
ID of the member to update.
firstName
string
OPTIONAL
Update first name.
lastName
string
OPTIONAL
Update last name.
role
string
OPTIONAL
New role (admin, player, or sub). Restricted to admins.
handicap
number
OPTIONAL
Updated handicap value.
BASH
Remove Player
DELETERemove a player from the league. Restricted to admins.
PATH/leagues/{slug}/players
Parameters
memberId
string
REQUIRED
ID of the member to remove.
BASH
Bulk Import
POSTImport multiple players at once. Useful for initializing a new league from a spreadsheet export.
PATH/leagues/{slug}/players/bulk
Parameters
players
array
REQUIRED
Array of player objects to import.
BASH
Courses
List All Courses
GETReturns a paginated list of all golf courses available in the Leaguely global database.
PATH/courses
BASH
League Courses
GETReturns only the courses that are currently active and used by the specified league.
PATH/leagues/{slug}/courses
BASH
Add Course to League
POSTAdd a course from the global database to your league's active rotation.
PATH/leagues/{slug}/courses
Parameters
courseId
string
REQUIRED
ID of the course to add.
BASH
Get Course
GETRetrieves detailed scorecard information for a course, including tees, yardages, pars, and handicaps for every hole.
PATH/courses/{courseId}
BASH
Scan Course (AI)
POSTUpload an image of a physical scorecard to automatically extract course data using our AI engine.
PATH/courses/scan
Parameters
image
string
REQUIRED
Base64 encoded image string.
BASH
Schedule & Rounds
Get Schedule
GETReturns the complete season schedule, grouped by rounds and weeks.
PATH/leagues/{slug}/schedule
BASH
Generate Schedule
POSTTriggers the scheduling engine to automatically generate matchups for the season based on the round-robin algorithm.
PATH/leagues/{slug}/schedule/generate
Parameters
seasonId
string
REQUIRED
The ID of the season to schedule.
weeks
number
REQUIRED
Number of regular season weeks to generate.
BASH
Get Round
GETRetrieves details for a specific round, including all pairings, tee times, and course information.
PATH/leagues/{slug}/rounds/{roundId}
BASH
Scoring
Get Match
GETReturns the full state of a match, including players, live scores, hole-by-hole results, and calculated points.
PATH/leagues/{slug}/matches/{matchId}
BASH
Submit Score
POSTSubmit or update a score for a player on a specific hole. Calculates net score and match points instantly.
PATH/scores
Parameters
matchPlayerId
string
REQUIRED
The ID linking the player to the match.
holeId
string
REQUIRED
The ID of the hole being scored.
grossScore
number
REQUIRED
The number of strokes taken.
BASH
Get Leaderboard
GETReturns current standings for the league, sorted by points or other configured metrics.
PATH/leagues/{slug}/leaderboard
BASH
Sub Requests
List Requests
GETList all open requests for substitutes for upcoming matches.
PATH/leagues/{slug}/sub-requests
BASH
Create Request
POSTPost a new request for a sub for a specific match.
PATH/leagues/{slug}/sub-request
Parameters
matchId
string
REQUIRED
The match ID where a sub is needed.
note
string
OPTIONAL
Optional note for potential subs.
BASH