Skip to content

Gateway Endpoints ​

Base URL: https://g2-elite-gateway.2pw.workers.dev

Public ​

GET /api/health ​

Health check. No auth required.

GET /join/:code ​

Public invite link redirect page. Shows the invite code and "Open in App" button.


Onboarding (Clerk auth only, no org required) ​

GET /api/me ​

Get the current user's profile.

GET /api/me/orgs ​

Get the current user's org memberships, grouped by org with roles.

Response:

json
{
  "memberships": [
    {
      "orgId": "uuid",
      "orgName": "The Farm League",
      "orgCode": "FARM",
      "roles": [
        { "membershipId": "uuid", "role": "admin", "isApproved": true }
      ]
    }
  ]
}

GET /api/invite/:code ​

Validate an invite code. Returns org name and role.

POST /api/join ​

Join an org using an invite code.

Body: { "code": "FARM-ADMIN-2026" }


Org Admin (Clerk + Org context, admin role) ​

GET /api/org/me ​

Get the current user's org context.

POST /api/org/invites ​

Generate a new invite code.

Body:

json
{
  "role": "parent",
  "maxUses": 100,
  "expiresInDays": 30
}

Response includes: invite code, deep link, web link, QR data.

GET /api/org/invites ​

List all invite codes for the org.

GET /api/org/pending-approvals ​

List pending membership requests (umpire/staff).

POST /api/org/pending-approvals/:membershipId ​

Approve or deny a membership.

Body: { "action": "approve" } or { "action": "deny" }

Internal Documentation — Do Not Share