https://your-shard.example.com/api/v1/status
Owner API Docs
Automate the net without handing over the keys.
Private shards expose a scoped Owner API at /api/v1. Use it for ops bots, roster automation, live status panels, ACARS alerts, archive workflows, and dashboards while central still validates privileged writes.
Authorization: Bearer scok_...
netUid
Numeric netId is a live slot. netUid persists across archive and restore.
Quick Start
Generate a key, hit your shard, then automate from there.
Owner API keys are created from the shard control panel or the desktop client's Advanced API Integration tab. The secret is shown once, stored only as a hash, and can be revoked at any time.
1. Smoke test a key
$Shard = "https://your-shard.example.com"
$Key = "scok_your_key_here"
Invoke-RestMethod "$Shard/api/v1/status" `
-Headers @{ Authorization = "Bearer $Key" }
Use a key with read:status. If this works, the key, shard URL, and reverse proxy path are all sane.
2. Assign a user to a net
$Headers = @{
Authorization = "Bearer $Key"
"Content-Type" = "application/json"
}
$Body = @{
userId = "123456789012345678"
netUid = "net_jmqbkeg5s74cjkezqybwkhny"
action = "assign"
} | ConvertTo-Json -Depth 5
Invoke-RestMethod "$Shard/api/v1/assignments" `
-Method POST -Headers $Headers -Body $Body
Requires write:assignments. Use action = "unassign" to remove the same assignment.
3. Map Discord roles to nets
$Body = @{
rules = @(
@{
roleId = "1505521308744679464"
netUids = @("net_jmqbkeg5s74cjkezqybwkhny")
}
)
} | ConvertTo-Json -Depth 6
Invoke-RestMethod "$Shard/api/v1/rules" `
-Method POST -Headers $Headers -Body $Body
Requires write:rules. Connected clients receive effective assignments from their Discord roles.
Auth & Scopes
Use the smallest key that can do the job.
Owner keys are guild-scoped. A key for one shard cannot act on another guild, and write actions are re-validated before they change active comms state.
Read scopes
read:status status, features, public token
read:roster connected operators
read:roster:roles include Discord role IDs
read:assignments stored assignments and rules
read:events SSE stream and webhooks
read:metrics JSON and Prometheus metrics
read:audit recent Owner API activity
Write scopes
write:assignments assign, bulk, temporary TTL
write:nets create, rename, remove active nets
write:archive local archive catalog and restore
write:operation open or close the operation
manage:features update shard feature flags and public net visibility
write:rules role-to-net auto assignment
write:presets save and apply op templates
write:acars overlay broadcast alerts
write:clients disconnect an operator
Never ship a privileged scok_ key in public browser JavaScript. For public websites, use /api/v1/public-token and the embed endpoints.
Endpoint Reference
The full shard Owner API surface.
Unless marked public, requests use Authorization: Bearer scok_.... JSON write requests should send Content-Type: application/json.
| Group | Method | Path | Scope | Body / Query | What it does |
|---|---|---|---|---|---|
| Read / Status | GET | /api/v1/openapi.json | None | None | Machine-readable OpenAPI spec for custom tooling and AI agents. |
| Read / Status | GET | /api/v1/status | read:status | None | Guild status, operation state, feature flags, Public Net status, nets, occupancy, and current transmit state. Enabled Public Net appears as a virtual/protected net entry. |
| Read / Status | GET | /api/v1/roster | read:roster | Add read:roster:roles to include roles. | Connected operators with display name, nets, transport, transmit state, and connected time. |
| Read / Status | GET | /api/v1/assignments | read:assignments | None | Current stored assignment map from the shard's latest central config. |
| Read / Status | GET | /api/v1/features | read:status | None | Current shard feature toggles, including public net, global PTT, ACARS, and related flags. |
| Read / Status | GET | /api/v1/public-net | read:status | None | Current public net visibility, display name, and role gates. |
| Assignments / Nets | POST | /api/v1/assignments | write:assignments | {"userId":"123","netUid":"net_...","action":"assign"} | Assigns or unassigns one user from one net. netId is accepted, but netUid is preferred. |
| Assignments / Nets | POST | /api/v1/assignments/bulk | write:assignments | {"assignments":[...]} | Bulk assign or unassign up to 200 assignment actions. Each item can carry its own action. |
| Assignments / Nets | POST | /api/v1/assignments/temporary | write:assignments | {"userId":"123","netUid":"net_...","expiresMinutes":30} | Assigns immediately, then the shard auto-unassigns after ttlMs, expiresMinutes, or minutes. |
| Assignments / Nets | POST | /api/v1/nets | write:nets | {"name":"Strike Net"} | Creates a new active net through central validation and returns both numeric slot and persistent UID. |
| Assignments / Nets | POST | /api/v1/nets/rename | write:nets | {"netUid":"net_...","name":"Air Wing"} | Renames an existing net. netId fallback exists for older tooling. |
| Assignments / Nets | DELETE | /api/v1/nets/:ref | write:nets | Path :ref can be netUid or netId. | Archives/removes an active net, cleaning relay targets and active assignments for that net. |
| Assignments / Nets | POST | /api/v1/nets/remove | write:nets | {"netUid":"net_..."} | Alternate remove endpoint for clients that prefer JSON bodies over DELETE path params. |
| Archive | GET | /api/v1/archive | write:archive | Optional search query. | Lists/searches stored channel configurations from the shard-local archive catalog. |
| Archive | POST | /api/v1/archive | write:archive | Archived channel payload. | Creates or upserts a shard-local archived channel entry with locally minted UID support. |
| Archive | GET | /api/v1/archive/sync/status | write:archive | None | Shows pending local operation count and checkpoint hash/version for shard-to-central backup sync. |
| Archive | GET | /api/v1/archive/:uid | write:archive | Path UID. | Reads one stored channel configuration from the local archive DB. |
| Archive | POST PATCH | /api/v1/archive/:uid | write:archive | Name, notes, tags, assignments, relay metadata. | Updates an archived channel locally and queues the operation for checkpoint sync. |
| Archive | DELETE | /api/v1/archive/:uid | write:archive | Path UID. | Permanently deletes a stored archived channel entry from the local catalog. |
| Archive | POST | /api/v1/archive/:uid/restore | write:archive | Optional restore options. | Central-approved restore into an active net using the original UID and a fresh numeric slot. |
| Operation / Automation | POST | /api/v1/operation | write:operation | {"open":true} | Opens or closes the operation and broadcasts a config update to connected clients. |
| Operation / Automation | POST | /api/v1/features | manage:features | {"features":{"globalPttEnabled":true}} | Updates shard feature toggles through central validation. |
| Operation / Automation | POST | /api/v1/public-net | manage:features | {"name":"Public Rally Net","roleIds":["123"]} | Shows or re-adds the public net, optionally overriding name and role gates. |
| Operation / Automation | POST | /api/v1/public-net/hide | manage:features | Optional empty JSON body. | Hides the public net while preserving its configured name and role gates. |
| Operation / Automation | POST | /api/v1/public-net/remove | manage:features | Optional empty JSON body. | Hides the public net and resets its name and role gates back to defaults. |
| Operation / Automation | POST | /api/v1/public-net/restore | manage:features | Optional name and role overrides. | Restores the public net after it was hidden or removed. |
| Operation / Automation | GET | /api/v1/rules | read:assignments | None | Lists role-to-net auto assignment rules distributed in shard config. |
| Operation / Automation | POST | /api/v1/rules | write:rules | {"rules":[{"roleId":"456","netUids":["net_..."]}]} | Replaces role-to-net auto assignment rules. Connected clients get effective assignments from roles. |
| Operation / Automation | GET | /api/v1/presets | write:presets | None | Lists saved operation presets stored beside shard local config. |
| Operation / Automation | POST | /api/v1/presets | write:presets | {"name":"Friday Op","nets":[],"assignments":[]} | Creates or replaces a preset. Applying still uses central validation for active writes. |
| Operation / Automation | DELETE | /api/v1/presets/:name | write:presets | URL-decoded name. | Deletes a saved preset by name. |
| Operation / Automation | POST | /api/v1/presets/:name/apply | write:presets | Optional apply options. | Applies net mutations, assignments, and operation state from a preset. |
| Alerts / Clients | POST | /api/v1/acars | write:acars | {"text":"Briefing in 5","senderName":"Ops"} | Broadcasts a short ACARS overlay alert to connected users. Premium shard only; heavily rate-limited. |
| Alerts / Clients | POST | /api/v1/clients/disconnect | write:clients | {"userId":"123"} | Disconnects a connected operator from the shard with a control reason. |
| Events / Webhooks | GET | /api/v1/stream | read:events | SSE request. | Live event stream for joins, leaves, PTT, assignment/config changes, ACARS, and operation changes. |
| Events / Webhooks | GET | /api/v1/webhooks | read:events | None | Lists registered webhooks and supported event types. Secrets are never returned after creation. |
| Events / Webhooks | POST | /api/v1/webhooks | read:events | {"url":"https://example.com/starcomms","events":["user.joined"]} | Registers an HMAC-signed webhook and returns the secret once. |
| Events / Webhooks | DELETE | /api/v1/webhooks/:id | read:events | Path ID. | Removes a webhook. Repeated delivery failures can auto-disable delivery. |
| Metrics / Audit / Public | GET | /api/v1/metrics | read:metrics | ?sinceMinutes=60 | JSON uptime, connected user counts, talk-time totals, and occupancy samples for the current process. |
| Metrics / Audit / Public | GET | /api/v1/metrics/prometheus | read:metrics | None | Prometheus text-format metrics for Grafana/Prometheus stacks. |
| Metrics / Audit / Public | GET | /api/v1/audit | read:audit | ?limit=100 | Recent Owner API calls handled by this shard. |
| Metrics / Audit / Public | GET | /api/v1/public-token | read:status | None | Creates signed read-only status and widget URLs for websites. |
| Metrics / Audit / Public | GET | /api/v1/embed/status?token=... | Public token | URL token. | Public read-only JSON status. No scok_ key required. |
| Metrics / Audit / Public | GET | /api/v1/embed/widget?token=... | Public token | URL token. | Public embeddable HTML status widget for org sites. |
Use Cases
What owners actually build with this.
The API is meant for server-side tools: Discord bots, scheduler jobs, dashboards, staff portals, and op planning systems.
Build tonight's board from signups.
Your planner exports signed-up members and desired squads. Your bot creates/renames nets, applies role rules or bulk assignments, opens the op, then sends an ACARS briefing.
Auto-sort members by role.
Map @Pilot, @Ground, and @Command to persistent netUid values so clients land in the right comms the moment they join.
Show the org what is live.
Use a public token for a safe website widget, or a private status key for richer dashboards that show occupancy, talking users, and operation state.
React instead of polling.
Use /stream or webhooks for live join, leave, PTT, assignment, config, and ACARS events. Great for attendance and commander alerts.
Keep every old channel layout.
Archive writes are shard-local first, so a private shard can store a large catalog of past nets, notes, assignments, tags, and restore points without hammering central.
Give staff only what they need.
Create one key for read-only dashboards, one for ACARS, one for assignments, and one for full op automation. Revoke each independently if a bot is replaced.