# API Reference

Complete endpoint documentation for the sTvOS v1 API.

The sTvOS v1 API is a RESTful JSON API organised around multi-tenant client scoping. All endpoints are prefixed with /api/v1.

   
Base URL https://api.studiostv.net/api/v1
Protocol HTTPS
Format JSON request and response bodies
Version v1 (current, stable)

# Client-Facing APIs

These APIs are used by mobile apps, web frontends, and third-party integrators building on sTvOS.


# Portal APIs

Dedicated APIs for partner staff and trainer self-service.


# Authentication Overview

Most endpoints require one or more authentication layers:

Method Header When to Use
Client API Key X-API-Key: <key> Every client-scoped request
Bearer Token Authorization: Bearer <jwt> User-specific operations
Partner JWT Authorization: Bearer <jwt> Partner portal (no API key needed)

# Public Endpoints

These endpoints require no authentication:

Method Path Description
GET /health Health check with uptime and version
GET /health/detailed Includes memory, platform, Node.js version
GET /app/config Default app configuration and branding
GET /app/join/:code Deep link voucher validation
POST /invite/check Trainer invite code validation
POST /partner-auth/login Partner staff login
POST /partner-auth/refresh Partner token refresh

# Response Envelope

{
  "success": true,
  "data": { ... }
}
{
  "error": "Human-readable description",
  "code": "MACHINE_READABLE_CODE",
  "details": "Additional context"
}
{
  "success": true,
  "data": {
    "items": [ ... ],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 150,
      "totalPages": 8
    }
  }
}

# HTTP Status Codes

Status Meaning
200 Success
201 Created
400 Bad request -- invalid parameters or body
401 Unauthorized -- missing or invalid API key / token
403 Forbidden -- insufficient permissions
404 Resource not found
429 Rate limit exceeded
500 Internal server error