API Overview
The Escluse REST API allows programmatic access to all platform features.
Base URL
https://api.esluce.com/api/v1Authentication
All API requests require a Bearer token in the Authorization header:
bash
curl -H "Authorization: Bearer {token}" \
https://api.esluce.com/api/v1/serversTokens are obtained via Supabase authentication:
bash
# Sign in
curl -X POST https://{project}.supabase.co/auth/v1/token?grant_type=password \
-H "apikey: {supabase_anon_key}" \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "password"}'Response Format
All responses follow a standard format:
json
{
"data": { ... },
"status": "success",
"message": "Optional message"
}Error Responses
json
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": [...]
},
"status": "error"
}Pagination
List endpoints support pagination:
GET /api/v1/servers?page=1&limit=20Response includes pagination metadata:
json
{
"data": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 100,
"pages": 5
}
}Rate Limiting
API requests are rate-limited based on your subscription plan.
Response headers:
X-RateLimit-Limit: Maximum requests per minuteX-RateLimit-Remaining: Requests remaining in windowX-RateLimit-Reset: Unix timestamp when limit resets
WebSocket
Real-time updates via WebSocket:
javascript
const ws = new WebSocket('wss://api.esluce.com/ws', {
headers: { 'Authorization': 'Bearer ' + token }
});
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
// Handle: { type: 'server_status', data: {...} }
};SDK
Official SDKs available:
Next Steps
- Servers API - Server CRUD operations
- Nodes API - Node management
- Billing API - Subscription and payments