Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 133 additions & 1 deletion api-reference/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
{ "name": "D-Sports Cash", "description": "D-Sports Cash balance" },
{ "name": "Dashboard", "description": "Dashboard stats and balance" },
{ "name": "Products", "description": "Products and packs catalog" },
{ "name": "Webhooks", "description": "RevenueCat webhook" },
{ "name": "Leagues", "description": "Leagues list and metadata" },
{ "name": "Webhooks", "description": "RevenueCat and leagues-sync webhooks" },
{ "name": "Misc", "description": "Image proxy, crypto prices, upload, feedback" },
{ "name": "Auth and onboarding", "description": "Domain grouping for auth, profile, onboarding, and identity flows" },
{ "name": "Social and locker room", "description": "Domain grouping for social feed, follows, and community interactions" },
Expand Down Expand Up @@ -1071,6 +1072,137 @@
"security": [{ "bearerAuth": [] }],
"responses": { "200": { "description": "OK" } }
}
},
"/api/leagues": {
"get": {
"tags": ["Leagues", "Teams"],
"summary": "List leagues",
"description": "Returns all leagues with team counts. Optionally filter by country.",
"parameters": [
{ "name": "country", "in": "query", "schema": { "type": "string" }, "description": "Filter by country (case-insensitive)." }
],
"security": [],
"responses": {
"200": { "description": "{ success, data: { leagues } }" },
"500": { "description": "Failed to list leagues" }
}
}
},
"/api/user/all": {
"get": {
"tags": ["User", "Social and locker room"],
"summary": "List community users",
"description": "Paginated list of onboarded users with stats. Rate-limited to 30 requests per minute.",
"parameters": [
{ "name": "limit", "in": "query", "schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 100 }, "description": "Maximum number of users to return." },
{ "name": "excludeFollowing", "in": "query", "schema": { "type": "string", "enum": ["true", "false"], "default": "false" }, "description": "Exclude users the caller already follows." }
],
"security": [{ "bearerAuth": [] }],
"responses": {
"200": { "description": "{ success, data: { users, total } }" },
"401": { "description": "Unauthorized" },
"429": { "description": "Rate limited" }
}
}
},
"/api/user/check-username": {
"get": {
"tags": ["User", "Auth and onboarding"],
"summary": "Check username availability",
"description": "Returns whether a handle/username is available (case-insensitive).",
"parameters": [
{ "name": "username", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The username to check." }
],
"security": [],
"responses": {
"200": { "description": "{ success, data: { available } }" },
"400": { "description": "Username is required" }
}
}
},
"/api/thirdweb-link": {
"post": {
"tags": ["Wallets", "Wallet and web3"],
"summary": "Create Thirdweb link",
"description": "Returns the authenticated user's ID and email for Thirdweb wallet linking.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["payload"],
"properties": { "payload": { "description": "Arbitrary payload (must be truthy)." } }
}
}
}
},
"security": [{ "bearerAuth": [] }],
"responses": {
"201": { "description": "{ success, data: { userId, email } }" },
"400": { "description": "Invalid payload" },
"401": { "description": "Unauthorized" }
}
}
},
"/api/thirdweb-proxy": {
"get": {
"tags": ["Wallets", "Wallet and web3", "Platform and infrastructure"],
"summary": "Proxy Thirdweb GET request",
"description": "Proxies GET requests to allowlisted Thirdweb upstream URLs (RPC and embedded-wallet endpoints).",
"parameters": [
{ "name": "url", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The upstream Thirdweb URL to proxy to." }
],
"security": [],
"responses": {
"200": { "description": "Proxied upstream response" },
"400": { "description": "Invalid or missing url" }
}
},
"post": {
"tags": ["Wallets", "Wallet and web3", "Platform and infrastructure"],
"summary": "Proxy Thirdweb POST request",
"description": "Proxies POST requests to allowlisted Thirdweb upstream URLs. Request body is forwarded as-is.",
"parameters": [
{ "name": "url", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The upstream Thirdweb URL to proxy to." }
],
"requestBody": {
"content": { "application/json": { "schema": { "type": "object", "description": "Passthrough body forwarded to upstream." } } }
},
"security": [],
"responses": {
"200": { "description": "Proxied upstream response" },
"400": { "description": "Invalid or missing url" }
}
}
},
"/api/v1/product_entitlement_mapping": {
"get": {
"tags": ["Products", "D-Sports Cash", "Commerce and purchases"],
"summary": "Get product-entitlement mapping",
"description": "Returns the mapping of product IDs to entitlements (D-Sports Cash tiers and Frontline Pass). Used by RevenueCat and mobile clients.",
"security": [],
"responses": {
"200": { "description": "{ success, data: { mappings } }" },
"500": { "description": "Internal server error" }
}
}
},
"/api/webhooks/leagues-sync": {
"post": {
"tags": ["Webhooks", "Teams"],
"summary": "Leagues sync webhook",
"description": "Triggered by CI to synchronize league data from the leagues repository into the database. Requires x-webhook-secret header.",
"parameters": [
{ "name": "x-webhook-secret", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Must match the LEAGUES_WEBHOOK_SECRET environment variable." }
],
"security": [],
"responses": {
"200": { "description": "{ success, data: { created, updated, errors, total } }" },
"401": { "description": "Unauthorized" },
"500": { "description": "Sync failed" }
}
}
}
},
"components": {
Expand Down
Loading