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/mobile

Authentication

Sign In (Magic Link)

POST
Initiate 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
curl -X POST https://api.leaguely.app/api/mobile/auth/signin \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "redirectUri": "leaguely://auth/callback"
  }'

Sign Out

POST
Sign out the current user and invalidate their session.
PATH/auth/signout
BASH
curl -X POST https://api.leaguely.app/api/mobile/auth/signout \
  -H "Cookie: auth_session=..."

Get Profile

GET
Retrieve detailed information about the currently authenticated user, including their name, email, and preferences.
PATH/profile
BASH
curl -X GET https://api.leaguely.app/api/mobile/profile \
  -H "Cookie: auth_session=..."

Update Profile

PUT
Update the authenticated user's profile information.
PATH/profile

Parameters

name
string
OPTIONAL
Full name of the user.
notifications
object
OPTIONAL
Notification preferences.
BASH
curl -X PUT https://api.leaguely.app/api/mobile/profile \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tiger Woods"
  }'

Admin (Super Admin)

List Invites

GET
List all active organization invites. Restricted to super admins.
PATH/admin/invites
BASH
curl -X GET https://api.leaguely.app/api/mobile/admin/invites \
  -H "Cookie: auth_session=..."

Create Invite

POST
Generate a new organization invite link.
PATH/admin/invites

Parameters

email
string
REQUIRED
Email to send the invite to (optional if just generating link).
BASH
curl -X POST https://api.leaguely.app/api/mobile/admin/invites \
  -H "Content-Type: application/json" \
  -d '{"email": "neworg@example.com"}'

Revoke Invite

DELETE
Revoke and delete an active invite.
PATH/admin/invites/{id}
BASH
curl -X DELETE https://api.leaguely.app/api/mobile/admin/invites/inv-123 \
  -H "Cookie: auth_session=..."

Organizations

List Organizations

GET
Returns a list of all organizations that the authenticated user is a member of.
PATH/organizations
BASH
curl -X GET https://api.leaguely.app/api/mobile/organizations \
  -H "Cookie: auth_session=..."

Get Organization

GET
Retrieves the details of an organization using its unique slug.
PATH/organizations/{slug}

Parameters

slug
string
REQUIRED
The unique slug identifier for the organization.
BASH
curl -X GET https://api.leaguely.app/api/mobile/organizations/my-org \
  -H "Cookie: auth_session=..."

Create Organization

POST
Create 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
curl -X POST https://api.leaguely.app/api/mobile/organizations \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My New Org",
    "inviteToken": "abc-123"
  }'

Delete Organization

DELETE
Permanently 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
curl -X DELETE https://api.leaguely.app/api/mobile/organizations/my-org \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org-123",
    "confirmName": "My New Org"
  }'

Leagues

List Leagues

GET
Returns a list of all leagues the authenticated user belongs to. Includes both admin and player memberships.
PATH/leagues
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues \
  -H "Cookie: auth_session=..."

League Dashboard

GET
Retrieves a summary for the league dashboard, including the next scheduled match, recent activity, and quick stats.
PATH/leagues/{slug}/dashboard
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/dashboard \
  -H "Cookie: auth_session=..."

Get Configuration

GET
Fetch the full configuration settings for the league, including scoring rules, handicap settings, and schedule preferences.
PATH/leagues/{slug}/configuration
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/configuration \
  -H "Cookie: auth_session=..."

Check Slug Availability

POST
Checks 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/check-slug \
  -H "Content-Type: application/json" \
  -d '{"slug": "my-new-league"}'

Update Configuration

PATCH
Update 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
curl -X PATCH https://api.leaguely.app/api/mobile/leagues/super-league/configuration \
  -H "Content-Type: application/json" \
  -d '{
    "handicapSystem": "usga",
    "minScoresToCalculate": 5
  }'

Delete League

POST
Permanently 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/delete \
  -H "Content-Type: application/json" \
  -d '{
    "leagueId": "lg-123",
    "confirmName": "Super League"
  }'

Impersonate Player

POST
Admin 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/impersonate \
  -H "Content-Type: application/json" \
  -d '{"userId": "usr-456"}'

Teams

List Teams

GET
Returns a list of all teams competing in the specified league.
PATH/leagues/{slug}/teams
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/teams \
  -H "Cookie: auth_session=..."

Create Team

POST
Create 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/teams \
  -H "Content-Type: application/json" \
  -d '{
    "name": "The Birdie Boys",
    "memberIds": ["mem-123", "mem-456"]
  }'

Get Team

GET
Retrieves detailed information about a specific team, including its full roster of players.
PATH/leagues/{slug}/teams/{teamId}
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/teams/team-123 \
  -H "Cookie: auth_session=..."

Delete Team

DELETE
Permanently delete a team from the league. This does not remove the players from the league.
PATH/leagues/{slug}/teams/{teamId}
BASH
curl -X DELETE https://api.leaguely.app/api/mobile/leagues/super-league/teams/team-123 \
  -H "Cookie: auth_session=..."

Add Member to Team

POST
Add 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/teams/team-123/members \
  -H "Content-Type: application/json" \
  -d '{
    "leagueMemberId": "mem-789"
  }'

Remove Member from Team

DELETE
Remove 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
curl -X DELETE https://api.leaguely.app/api/mobile/leagues/super-league/teams/team-123/members?leagueMemberId=mem-789 \
  -H "Cookie: auth_session=..."

Players

List Players

GET
Returns a directory of all players in the league, including active players, subs, and admins.
PATH/leagues/{slug}/players
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/players \
  -H "Cookie: auth_session=..."

Invite Player

POST
Invite 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/players \
  -H "Content-Type: application/json" \
  -d '{
    "email": "friend@golf.com",
    "firstName": "Tiger",
    "lastName": "Woods",
    "role": "player"
  }'

Update Player

PATCH
Update 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
curl -X PATCH https://api.leaguely.app/api/mobile/leagues/super-league/players \
  -H "Content-Type: application/json" \
  -d '{
    "memberId": "mem-123",
    "role": "admin"
  }'

Remove Player

DELETE
Remove a player from the league. Restricted to admins.
PATH/leagues/{slug}/players

Parameters

memberId
string
REQUIRED
ID of the member to remove.
BASH
curl -X DELETE https://api.leaguely.app/api/mobile/leagues/super-league/players \
  -H "Content-Type: application/json" \
  -d '{"memberId": "mem-123"}'

Bulk Import

POST
Import 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/players/bulk \
  -H "Content-Type: application/json" \
  -d '{
    "players": [
      { "email": "new@player.com", "firstName": "John", "lastName": "Doe", "handicap": 12.5 }
    ]
  }'

Courses

List All Courses

GET
Returns a paginated list of all golf courses available in the Leaguely global database.
PATH/courses
BASH
curl -X GET https://api.leaguely.app/api/mobile/courses \
  -H "Cookie: auth_session=..."

League Courses

GET
Returns only the courses that are currently active and used by the specified league.
PATH/leagues/{slug}/courses
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/courses \
  -H "Cookie: auth_session=..."

Add Course to League

POST
Add 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/courses \
  -H "Content-Type: application/json" \
  -d '{"courseId": "course-123"}'

Get Course

GET
Retrieves detailed scorecard information for a course, including tees, yardages, pars, and handicaps for every hole.
PATH/courses/{courseId}
BASH
curl -X GET https://api.leaguely.app/api/mobile/courses/course-123 \
  -H "Cookie: auth_session=..."

Scan Course (AI)

POST
Upload 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
curl -X POST https://api.leaguely.app/api/mobile/courses/scan \
  -H "Content-Type: application/json" \
  -d '{"image": "data:image/jpeg;base64,..."}'

Schedule & Rounds

Get Schedule

GET
Returns the complete season schedule, grouped by rounds and weeks.
PATH/leagues/{slug}/schedule
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/schedule \
  -H "Cookie: auth_session=..."

Generate Schedule

POST
Triggers 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/schedule/generate \
  -H "Content-Type: application/json" \
  -d '{"seasonId": "season-123", "weeks": 10}'

Get Round

GET
Retrieves details for a specific round, including all pairings, tee times, and course information.
PATH/leagues/{slug}/rounds/{roundId}
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/rounds/round-123 \
  -H "Cookie: auth_session=..."

Scoring

Get Match

GET
Returns the full state of a match, including players, live scores, hole-by-hole results, and calculated points.
PATH/leagues/{slug}/matches/{matchId}
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/matches/match-123 \
  -H "Cookie: auth_session=..."

Submit Score

POST
Submit 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
curl -X POST https://api.leaguely.app/api/scores \
  -H "Content-Type: application/json" \
  -d '{
    "matchPlayerId": "mp-123",
    "holeId": "hole-1",
    "grossScore": 4
  }'

Get Leaderboard

GET
Returns current standings for the league, sorted by points or other configured metrics.
PATH/leagues/{slug}/leaderboard
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/leaderboard \
  -H "Cookie: auth_session=..."

Sub Requests

List Requests

GET
List all open requests for substitutes for upcoming matches.
PATH/leagues/{slug}/sub-requests
BASH
curl -X GET https://api.leaguely.app/api/mobile/leagues/super-league/sub-requests \
  -H "Cookie: auth_session=..."

Create Request

POST
Post 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
curl -X POST https://api.leaguely.app/api/mobile/leagues/super-league/sub-request \
  -H "Content-Type: application/json" \
  -d '{
    "matchId": "match-123",
    "note": "Going fishing"
  }'