EGOS Docs
Introduction
EGOS Homev1.0
  1. Docs
  2. Api Reference
  3. Overview

API Overview

Previous

Controller Setup

Next

Media Embedding Guide

    API Overview

    EGOS REST API and WebSocket reference

    2 min read

    API Overview

    EGOS Cloud provides a comprehensive REST API for managing games, components, devices, and more.

    Base URL

    https://your-egos-instance.com/api

    For local development:

    http://localhost:3000/api

    Authentication

    All API requests require authentication using JWT tokens:

    curl -H "Authorization: Bearer YOUR_TOKEN" \ https://your-egos-instance.com/api/games
    Note

    Obtain tokens through the AWS Amplify authentication flow.

    Response Format

    All responses follow a consistent format:

    Success Response

    { "success": true, "data": { ... } }

    Error Response

    { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid game ID format" } }

    Available Endpoints

    Games API

    MethodEndpointDescription
    GET/api/gamesList all games
    POST/api/gamesCreate a new game
    GET/api/games/:idGet game details
    PUT/api/games/:idUpdate game
    DELETE/api/games/:idDelete game

    Components API

    MethodEndpointDescription
    GET/api/componentsList components
    POST/api/componentsCreate component
    GET/api/components/:idGet component
    PUT/api/components/:idUpdate component
    DELETE/api/components/:idDelete component

    Devices API

    MethodEndpointDescription
    GET/api/devicesList registered devices
    GET/api/devices/:idGet device details
    POST/api/devices/:id/commandSend command

    Rate Limits

    TierRequests/minute
    Free60
    Pro600
    EnterpriseUnlimited
    Warning

    Exceeding rate limits will result in 429 (Too Many Requests) responses.

    WebSocket API

    For real-time updates, connect via MQTT over WebSocket:

    const client = mqtt.connect('wss://your-instance.com:9001'); client.on('connect', () => { client.subscribe('game/+/state'); }); client.on('message', (topic, message) => { console.log('State update:', JSON.parse(message)); });

    SDKs

    Official SDKs are available for:

    • JavaScript/TypeScript
    • Python (coming soon)
    • C# (coming soon)

    Next Steps

    Explore specific API endpoints:

    • Games API (coming soon)
    • Components API (coming soon)
    • Devices API (coming soon)