Skip to main content

D-Sports API

The primary API and backend for the D-Sports platform is d-sports-api (the PWA). It serves the web app, the native app (d-sports-engage-native), and is used by the marketing site (d-sports-site) where needed. Authentication, quests, Fan Rep, leaderboards, collectibles, shop, wallet, and games catalog flows all go through this API. Mic’d Up (d-sports-mic-d-up) has its own backend (Express + PostgreSQL) for live audio rooms and does not use the d-sports-api backend. d-sports-backend (Rust rewrite) is a parity/shim project. It is not the production API and is not the source of this OpenAPI spec.

How this reference is built

This API Reference uses a hybrid model:
  • OpenAPI endpoints for broad, generated route coverage (252 paths in the current spec).
  • Domain API guides for workflow notes, caveats, and implementation context by backend domain.
  • Coverage matrix for explicit publish/redact/exclude boundaries.
Use the API Fundamentals section for authentication and error handling guidance, the Domain API Guides section for integration context, and the Endpoints section for generated request/response reference from api-reference/openapi.json.

Coverage model

  • Public contributor docs prioritize integration-critical routes.
  • Sensitive admin internals, debug/dev-only, and cron/ops endpoints are intentionally excluded.
  • Selected admin/team-management routes are documented with redaction where contributor context is needed.
  • Remaining OpenAPI gaps are admin/debug/internal operations and the separate team-access freeze. Public and authenticated client routes are in the generated spec, including canonical /api/v1/engage quest, Rep, and locker-singularity ledger paths. PUT /api/packs/{id}/purchase is published as removed (410). POST /api/games/daily-spin/reward is published as deprecated. Staff-only POST /featured / POST /promos stay excluded. See the route coverage matrix.

Exclusion policy

By default, the following categories are excluded from public endpoint docs:
  • debug/dev-only routes
  • internal cron/ops routes
  • sensitive admin remediation/override internals

Curated domain pages vs generated OpenAPI

  • OpenAPI remains the primary generated endpoint index for public-safe routes.
  • Domain guides provide curated behavior notes and RBAC context.
  • Approved admin/team routes may be documented in curated domain pages even when absent in generated OpenAPI.

Domain guides

Authentication

d-sports-api uses Clerk for authentication. Most protected routes expect Authorization: Bearer <token>. Native OAuth can also redeem a one-time MobileSession hex token at POST /api/mobile/exchange for a Clerk sign-in ticket. Exact per-route security is defined in the OpenAPI spec.

d-sports-api

Backend and PWA: stack, features, and how to run it.

Mic'd Up backend

Separate backend for live audio rooms.