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.

Base URL Your shard public URL

https://your-shard.example.com/api/v1/status

Authentication Bearer owner key

Authorization: Bearer scok_...

Net identity Prefer netUid

Numeric netId is a live slot. netUid persists across archive and restore.

Start with a key

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.

Shard Registration

Supporters can register a private shard without waiting on a manual token.

Run /star-shard-request inside the main Star Comms Discord. The command is guild-scoped to that Discord only, opens a private Shard Registry ticket, validates the request, and delivers the shard token privately.

Who can run it

The requester must hold either the Command Net Supporter role or the Infrastructure Supporter role in the Star Comms support Discord.

The requester must also be the owner of the target Discord server or hold a Discord role with Administrator in that server.

What the form asks for

Target Discord guild ID, shard public URL, shard display name, host/runtime note, and the requester user ID. The owner user ID must match the person submitting the form.

The target guild should already be configured with Star Comms through the normal setup flow.

How the token behaves

The token is non-expiring by date and shown only once. If the supporter role is removed, the shard entitlement disables; if the role returns, the same token reactivates.

Safeguards prevent one supporter from claiming multiple shards and prevent one guild from being claimed by multiple supporters.

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 / StatusGET/api/v1/openapi.jsonNoneNoneMachine-readable OpenAPI spec for custom tooling and AI agents.
Read / StatusGET/api/v1/statusread:statusNoneGuild 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 / StatusGET/api/v1/rosterread:rosterAdd read:roster:roles to include roles.Connected operators with display name, nets, transport, transmit state, and connected time.
Read / StatusGET/api/v1/assignmentsread:assignmentsNoneCurrent stored assignment map from the shard's latest central config.
Read / StatusGET/api/v1/featuresread:statusNoneCurrent shard feature toggles, including public net, global PTT, ACARS, and related flags.
Read / StatusGET/api/v1/public-netread:statusNoneCurrent public net visibility, display name, and role gates.
Assignments / NetsPOST/api/v1/assignmentswrite:assignments{"userId":"123","netUid":"net_...","action":"assign"}Assigns or unassigns one user from one net. netId is accepted, but netUid is preferred.
Assignments / NetsPOST/api/v1/assignments/bulkwrite:assignments{"assignments":[...]}Bulk assign or unassign up to 200 assignment actions. Each item can carry its own action.
Assignments / NetsPOST/api/v1/assignments/temporarywrite:assignments{"userId":"123","netUid":"net_...","expiresMinutes":30}Assigns immediately, then the shard auto-unassigns after ttlMs, expiresMinutes, or minutes.
Assignments / NetsPOST/api/v1/netswrite:nets{"name":"Strike Net"}Creates a new active net through central validation and returns both numeric slot and persistent UID.
Assignments / NetsPOST/api/v1/nets/renamewrite:nets{"netUid":"net_...","name":"Air Wing"}Renames an existing net. netId fallback exists for older tooling.
Assignments / NetsDELETE/api/v1/nets/:refwrite:netsPath :ref can be netUid or netId.Archives/removes an active net, cleaning relay targets and active assignments for that net.
Assignments / NetsPOST/api/v1/nets/removewrite:nets{"netUid":"net_..."}Alternate remove endpoint for clients that prefer JSON bodies over DELETE path params.
ArchiveGET/api/v1/archivewrite:archiveOptional search query.Lists/searches stored channel configurations from the shard-local archive catalog.
ArchivePOST/api/v1/archivewrite:archiveArchived channel payload.Creates or upserts a shard-local archived channel entry with locally minted UID support.
ArchiveGET/api/v1/archive/sync/statuswrite:archiveNoneShows pending local operation count and checkpoint hash/version for shard-to-central backup sync.
ArchiveGET/api/v1/archive/:uidwrite:archivePath UID.Reads one stored channel configuration from the local archive DB.
ArchivePOST PATCH/api/v1/archive/:uidwrite:archiveName, notes, tags, assignments, relay metadata.Updates an archived channel locally and queues the operation for checkpoint sync.
ArchiveDELETE/api/v1/archive/:uidwrite:archivePath UID.Permanently deletes a stored archived channel entry from the local catalog.
ArchivePOST/api/v1/archive/:uid/restorewrite:archiveOptional restore options.Central-approved restore into an active net using the original UID and a fresh numeric slot.
Operation / AutomationPOST/api/v1/operationwrite:operation{"open":true}Opens or closes the operation and broadcasts a config update to connected clients.
Operation / AutomationPOST/api/v1/featuresmanage:features{"features":{"globalPttEnabled":true}}Updates shard feature toggles through central validation.
Operation / AutomationPOST/api/v1/public-netmanage:features{"name":"Public Rally Net","roleIds":["123"]}Shows or re-adds the public net, optionally overriding name and role gates.
Operation / AutomationPOST/api/v1/public-net/hidemanage:featuresOptional empty JSON body.Hides the public net while preserving its configured name and role gates.
Operation / AutomationPOST/api/v1/public-net/removemanage:featuresOptional empty JSON body.Hides the public net and resets its name and role gates back to defaults.
Operation / AutomationPOST/api/v1/public-net/restoremanage:featuresOptional name and role overrides.Restores the public net after it was hidden or removed.
Operation / AutomationGET/api/v1/rulesread:assignmentsNoneLists role-to-net auto assignment rules distributed in shard config.
Operation / AutomationPOST/api/v1/ruleswrite:rules{"rules":[{"roleId":"456","netUids":["net_..."]}]}Replaces role-to-net auto assignment rules. Connected clients get effective assignments from roles.
Operation / AutomationGET/api/v1/presetswrite:presetsNoneLists saved operation presets stored beside shard local config.
Operation / AutomationPOST/api/v1/presetswrite:presets{"name":"Friday Op","nets":[],"assignments":[]}Creates or replaces a preset. Applying still uses central validation for active writes.
Operation / AutomationDELETE/api/v1/presets/:namewrite:presetsURL-decoded name.Deletes a saved preset by name.
Operation / AutomationPOST/api/v1/presets/:name/applywrite:presetsOptional apply options.Applies net mutations, assignments, and operation state from a preset.
Alerts / ClientsPOST/api/v1/acarswrite:acars{"text":"Briefing in 5","senderName":"Ops"}Broadcasts a short ACARS overlay alert to connected users. Premium shard only; heavily rate-limited.
Alerts / ClientsPOST/api/v1/clients/disconnectwrite:clients{"userId":"123"}Disconnects a connected operator from the shard with a control reason.
Events / WebhooksGET/api/v1/streamread:eventsSSE request.Live event stream for joins, leaves, PTT, assignment/config changes, ACARS, and operation changes.
Events / WebhooksGET/api/v1/webhooksread:eventsNoneLists registered webhooks and supported event types. Secrets are never returned after creation.
Events / WebhooksPOST/api/v1/webhooksread:events{"url":"https://example.com/starcomms","events":["user.joined"]}Registers an HMAC-signed webhook and returns the secret once.
Events / WebhooksDELETE/api/v1/webhooks/:idread:eventsPath ID.Removes a webhook. Repeated delivery failures can auto-disable delivery.
Metrics / Audit / PublicGET/api/v1/metricsread:metrics?sinceMinutes=60JSON uptime, connected user counts, talk-time totals, and occupancy samples for the current process.
Metrics / Audit / PublicGET/api/v1/metrics/prometheusread:metricsNonePrometheus text-format metrics for Grafana/Prometheus stacks.
Metrics / Audit / PublicGET/api/v1/auditread:audit?limit=100Recent Owner API calls handled by this shard.
Metrics / Audit / PublicGET/api/v1/public-tokenread:statusNoneCreates signed read-only status and widget URLs for websites.
Metrics / Audit / PublicGET/api/v1/embed/status?token=...Public tokenURL token.Public read-only JSON status. No scok_ key required.
Metrics / Audit / PublicGET/api/v1/embed/widget?token=...Public tokenURL 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.

Ops recipe

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.

Discord automation

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.

Status panels

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.

Event response

React instead of polling.

Use /stream or webhooks for live join, leave, PTT, assignment, config, and ACARS events. Great for attendance and commander alerts.

Archive catalog

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.

Safety tools

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.