API overview
Current scope
The Go backend and console connect accounts, Google sign-in, platform RBAC, API tokens, SSH public keys, USD wallets, Stripe, email, files, announcements, contacts, audit and system monitoring. Website news details, announcements and contact submissions are connected. Google, Stripe, SMTP and storage still require real credentials and integration testing.
Teams, CPU/MIG GPU rentals, container creation, usage charges and SSH delivery are not connected. Unregistered rental paths return 404. See Accounts and console for page entry points.
Service paths
This documentation site does not serve business APIs. A separate Go backend applies pending numbered SQL migrations before opening HTTP in Docker deployments.
| Method and path | Purpose | Permission |
|---|---|---|
GET /healthz | Process liveness | Public |
GET /readyz | Database, migration and configured Redis readiness; 503 if unavailable | Public |
GET /openapi.json | Complete request, response, status and permission contract | Public |
GET /api/v1/public/config | Public service flags and Turnstile site key | Public |
GET /api/v1/system/info | Capabilities and configuration flags, without detailed metrics | Public |
GET /api/v1/admin/system/status | OS, container, Redis and database state visible to the backend | setting:read |
Readiness does not validate real Stripe, email or storage accounts and does not establish instance or SSH availability. Monitoring excludes secrets, connection strings, Redis keys and values, and raw INFO responses.
Authentication and responses
| Client | Credentials and restrictions |
|---|---|
| Browser | HttpOnly, SameSite=Strict cookie; Secure in production, fixed 24-hour expiry. Writes require X-CSRF-Token |
| API client | Authorization: Bearer nn_pat_...; access is the intersection of token scopes and current roles |
| Management static resources | An authorized browser session is required; PATs cannot replace it |
Sign-in and GET /api/v1/me return CSRF. The database validates sessions, PATs and roles; Redis does not hold login state. Password resets and Google unlinking revoke the user's old credentials. Administrator requests still check specific permissions and ownership.
Successful responses contain the endpoint DTO directly. Pagination and empty responses follow OpenAPI. Errors include error.code, an English error.message and request_id; clients localize by stable error code.
| Code | Meaning |
|---|---|
invalid_credentials | Invalid sign-in credentials or disabled account; HTTP 401 |
unauthenticated | No valid login credential; HTTP 401 |
permission_denied | Insufficient permission; HTTP 403 |
conflict | Version, state or idempotency conflict; HTTP 409 |
rate_limited | Too many requests; HTTP 429, with wait seconds in Retry-After |
Business API groups
Paths below use the /api/v1 prefix. Refer to OpenAPI for exact methods and fields.
| Group | Main paths |
|---|---|
| Accounts and Google | /auth/*, /me, /me/google |
| Credentials and keys | /me/sessions, /me/api-tokens, /ssh-keys |
| USD wallets and payments | /me/wallet, /me/wallet/transactions, /me/recharge-orders, /me/payment-methods |
| Public content and contact | /announcements, /news, /contact-messages |
| Files and personal activity | /files, /me/files, /me/audit-logs |
| Administration | /admin/users, /admin/roles, /admin/permissions, /admin/announcements, /admin/contact-messages, /admin/files, /admin/audit-logs, /admin/email-messages |
| Configuration and monitoring | /admin/settings, /admin/system/status |
| Stripe callback | /webhooks/stripe; verified server-side and not called by a page |
Amounts are USD decimal strings, not floating-point JSON numbers. The backend verifies and atomically credits Stripe top-ups; clients cannot credit their own wallets. Stripe stores payment cards, not the platform.
Configuration and human verification
Administrators manage Google, Stripe, SMTP and storage through /admin/system-settings or the configuration API. Secrets are encrypted in the database and never returned in plaintext. Omitted or null secret fields preserve existing values, empty strings clear them, and new values replace them. Writes require a version and setting:update; reads require setting:read.
Redis holds Google state, nonce and PKCE data for ten minutes. The database encryption master key stays in deployment configuration. Service secrets must not enter browser code or documentation.
Rate limits apply per IPv4 address or IPv6 /64 subnet and minute, using NOCTNODE_RATE_LIMIT_*. Counters are not shared across replicas; a gateway must enforce shared limits for that deployment.
Cloudflare Turnstile is off by default. When enabled, registration, sign-in, verification email requests, password reset requests and contacts require a fresh turnstile_token with actions register, login, verify_email, reset_password and contact. These frontends are connected. The backend checks hostname, action and success.
Verification failures return 403 human_verification_failed; provider failures return 503 human_verification_unavailable. Failures do not bypass checks. Public configuration exposes the site key; the secret remains on the server.