Skip to content

API Overview

Niuton exposes a RESTful JSON API at /api/. All endpoints require authentication unless noted otherwise.

Base URL

https://your-domain.net/api/

Authentication

All API requests must include a valid session cookie or Bearer token. See Authentication for details.

Response Format

All endpoints return JSON:

json
// Success
{
  "success": true,
  "data": { ... }
}

// Error
{
  "success": false,
  "error": "Error message"
}

Available Endpoints

EndpointDescriptionDocumentation
/api/login.phpAuthentication & 2FAAuth
/api/filesystem.phpFile operationsFilesystem
/api/sync.phpDelta sync protocolSync
/api/team-chat.phpChat rooms & messagesTeam Chat
/api/assistant.phpAurora AIAssistant
/api/apps.phpApp managementApps
/api/desktop-components.phpDesktop overrides & profilesDesktop Components
/api/trash.phpTrash operations
/api/routines.phpRoutine management & execution
/api/settings.phpUser settings
/api/system-config.phpAdmin config

Request Methods

  • GET — Read operations (list, get, search)
  • POST — Create and action operations
  • DELETE — Remove operations (where applicable)

Most endpoints use the action query parameter to determine the operation:

GET /api/filesystem.php?action=list&path=/Documents
POST /api/team-chat.php?action=send

Rate Limiting

Authentication endpoints enforce rate limiting:

  • 5 failed attempts → 15-minute lockout
  • Tracked per username in niuton_login_attempts table

Content Types

  • Request: application/json or application/x-www-form-urlencoded
  • Response: application/json
  • File uploads: multipart/form-data

AI-Powered Cloud Desktop OS