RESTful API for managing digital signage programmatically
Overview
TheiaCast provides a comprehensive RESTful API for managing digital signage devices, content, playlists, and broadcasts. All endpoints require authentication via JWT Bearer token or API key.
Base URL
http://your-server:5001
Interactive API Documentation (Swagger)
TheiaCast includes an interactive Swagger UI where you can explore and test all API endpoints:
http://your-server:5001/swagger
Using Swagger UI
Navigate to the Swagger UI URL
Click the "Authorize" button (lock icon)
Enter your JWT token in the format: Bearer YOUR_JWT_TOKEN
Click "Authorize"
Now you can test any endpoint directly from the browser
Authentication
TheiaCast supports two authentication methods:
JWT Bearer Tokens - Short-lived tokens (1 hour) for interactive use
API Keys - Long-lived tokens (years) for automation and integrations
Method 1: JWT Bearer Authentication
JWT tokens are ideal for web applications and interactive use. They expire after 1 hour but can be refreshed.
Get JWT Token
Endpoint:POST /auth/login
Request Body:
{
"username": "admin",
"password": "your-password",
"totpCode": "123456" // Optional - only if MFA is enabled
}
curl -X GET "http://localhost:5001/content" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Method 2: API Key Authentication
API keys are ideal for automation, scripts, CI/CD pipelines, and long-running integrations. They can be configured to never expire or expire after several years.
Create API Key
Endpoint:POST /api-keys
Authentication Required: JWT Bearer token (must be logged in to create API keys)
Request Body:
{
"name": "Production Automation Script",
"expiresInYears": 5 // Optional - null means never expires
}
{
"id": 1,
"key": "tc_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8",
"name": "Production Automation Script",
"prefix": "tc_a1b2c",
"createdAt": "2026-01-14T10:00:00Z",
"expiresAt": "2031-01-14T10:00:00Z",
"message": "⚠️ IMPORTANT: Save this API key now. You won't be able to see it again!"
}
⚠️ CRITICAL: The API key is only shown once upon creation. Store it securely - you cannot retrieve it again.
List Your API Keys
curl -X GET "http://localhost:5001/api-keys" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Store API key in environment variable
export THEIACAST_API_KEY="tc_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8"
# Use in scripts
curl -X GET "http://localhost:5001/content" \
-H "X-API-Key: $THEIACAST_API_KEY"
Comparison: JWT vs API Keys
Feature
JWT Bearer Tokens
API Keys
Lifespan
1 hour (refreshable)
Years or never expires
Use Case
Interactive web apps
Automation, scripts, CI/CD
Creation
Login with username/password
Create via authenticated endpoint
Header
Authorization: Bearer {token}
X-API-Key: {key}
Content Endpoints
Content items represent URLs, websites, or media that can be displayed on devices.
📄 Get All Content
Endpoint:GET /content
Retrieve all content items including URLs, auto-login credentials, and thumbnails.
curl -X GET "http://localhost:5001/content" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
➕ Create Content
Endpoint:POST /content
Create a new content item with optional auto-authentication.