Files
dotcom-arcade/docs/06-api-reference/README.md
T

4.9 KiB

API Reference Documentation

Complete REST API reference for Flashpoint Web backend service.

Base URL

Development: http://localhost:3100/api

Production: Configure via DOMAIN environment variable

Authentication

Most endpoints require JWT authentication. Include the access token in the Authorization header:

Authorization: Bearer <access_token>

Tokens are obtained via the /api/auth/login or /api/auth/register endpoints.

Response Format

All responses are in JSON format with consistent structure:

Success Response

{
  "data": { ... },
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 1234,
    "totalPages": 25
  }
}

Error Response

{
  "error": {
    "code": 400,
    "message": "Validation error: username must be at least 3 characters"
  }
}

HTTP Status Codes

  • 200 OK - Request successful
  • 201 Created - Resource created successfully
  • 400 Bad Request - Invalid request parameters
  • 401 Unauthorized - Missing or invalid authentication token
  • 403 Forbidden - Insufficient permissions
  • 404 Not Found - Resource not found
  • 409 Conflict - Resource already exists
  • 500 Internal Server Error - Server error

Rate Limiting

Configurable via RATE_LIMIT_* environment variables. Default: 100 requests per 15 minutes.

Rate limit headers included in responses:

  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-RateLimit-Reset: Time when rate limit resets (Unix timestamp)

API Endpoints by Category

Authentication

Games

Users

Roles & Permissions

Playlists

Play Tracking

Platforms & Tags

Complete Examples

See Request & Response Examples for complete workflow examples including:

  • User registration and login flow
  • Game search with filters
  • Game launch workflow
  • Play session tracking
  • Playlist management
  • Role-based access control examples

SDK Examples

See individual endpoint documentation for code examples in:

  • curl (command line)
  • JavaScript/TypeScript (axios)
  • Python (requests)
  • Go (net/http)

Versioning

API version is included in response headers: X-API-Version: 1.0.0

Breaking changes will increment major version number.

Support

For issues or questions: