SaoAI Documentation

Complete documentation for the SaoAI AI Operating System API and platform.

Quick Links

EnvironmentURL
Landinghttps://saoai.fun
CEO Dashboardhttps://app.saoai.fun
Backend APIhttps://api.saoai.fun
WebSocketwss://api.saoai.fun/ws
Demohttps://demo.saoai.fun
Staginghttps://staging.saoai.fun

Core API Endpoints

Auth

POST /api/v1/auth/login

POST /api/v1/auth/refresh

COO

POST /api/v1/coo/query — Ask COO anything

GET /api/v1/coo/status — COO runtime status

GET /api/v1/coo/thinking/{id} — COO thinking trace

Channels (Multi-Channel Gateway)

POST /api/v1/channels/message/receive — Receive message from any channel

POST /api/v1/channels/message/send — Send message through any channel

POST /api/v1/channels/notify — Send notification

POST /api/v1/channels/interact — Human interaction (approve/reject/etc.)

Workflows

GET /api/v1/workflows — List workflows

POST /api/v1/workflows — Create workflow

POST /api/v1/workflows/{id}/pause — Pause

POST /api/v1/workflows/{id}/resume — Resume

Collaboration

GET /api/v1/collab/employees

POST /api/v1/collab/tasks

POST /api/v1/collab/approvals/requests

GET /api/v1/collab/workspace/ceo

Telegram Setup

Webhook URL

https://api.saoai.fun/api/v1/channels/telegram/webhook

Setup Steps

  1. Create bot with @BotFather
  2. Set webhook: curl https://api.telegram.org/bot<TOKEN>/setWebhook?url=https://api.saoai.fun/api/v1/channels/telegram/webhook
  3. Add TELEGRAM_BOT_TOKEN to .env.production
  4. Link CEO's Telegram identity in Dashboard Settings → Telegram

DNS Checklist

TypeNameValue
Asaoai.funVPS_PUBLIC_IP
Aapp.saoai.funVPS_PUBLIC_IP
Aapi.saoai.funVPS_PUBLIC_IP
Ademo.saoai.funVPS_PUBLIC_IP
Astaging.saoai.funVPS_PUBLIC_IP
Adocs.saoai.funVPS_PUBLIC_IP
CNAMEwww.saoai.funsaoai.fun

Deployment Architecture

Internet
  └── Caddy / Nginx (ports 80,443)
       ├── saoai.fun      → landing (port 3000)
       ├── app.saoai.fun  → dashboard (port 3000)
       ├── api.saoai.fun  → backend (port 8000)
       │   └── /ws        → WebSocket upgrade
       ├── demo.saoai.fun → demo frontend (port 3000)
       ├── staging.saoai.fun → staging frontend (port 3000)
       └── docs.saoai.fun → docs static (port 3000)
  Backend
  └── PostgreSQL (pgvector) → :5432
  └── Redis → :6379